Skip to content

Commit

Permalink
#8 22.11.15 > 팩토리얼
Browse files Browse the repository at this point in the history
  • Loading branch information
beurmuz committed Nov 15, 2022
1 parent 44b286e commit 3d47a5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/inf/recursive,dfs/11_rere.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

function solution(n) {
let answer = 1;
function dfs(n) {
if (n === 1) return 1;
else return n * dfs(n - 1);
}
answer = dfs(n);
return answer;
}

console.log(solution(3));
2 changes: 1 addition & 1 deletion src/inf/recursive,dfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| 8 | X | 22.11.15😥 |
| 9 || 22.11.15😥 |
| 10 || 22.11.15😥 |
| 11 | O | O |
| 11 | O | 22.11.15 |
| 12 | X | O 한번 더 보기 |
| 13 | X | O 한번 더 보기 |
| 14 | X | O 잊기전에 다시풀기 |
Expand Down

0 comments on commit 3d47a5e

Please sign in to comment.