Skip to content

Instantly share code, notes, and snippets.

@simon0191
Created December 6, 2014 19:26
Show Gist options
  • Save simon0191/f7f241f1d44db3d46127 to your computer and use it in GitHub Desktop.
Save simon0191/f7f241f1d44db3d46127 to your computer and use it in GitHub Desktop.
function main(n) {
var sol = 1;
while(n > 1) sol*=(n--);
return sol;
}
/*
console.log(main(1));
console.log(main(2));
console.log(main(10));
console.log(main(8));
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment