Skip to content

Commit

Permalink
팩토리얼
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Apr 29, 2023
1 parent fa11c7a commit 2f3178e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Programmers/exam64.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function solution(n) {
let result = 1;
let i = 1;

while (result <= n) {
result *= i;
i++;
}

return i - 2;
}

0 comments on commit 2f3178e

Please sign in to comment.