We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15a9754 commit 63919d2Copy full SHA for 63919d2
level-4/올바른-괄호의-갯수&12929&.js
@@ -1,10 +1,7 @@
1
//https://github.com/codeisneverodd/programmers-coding-test
2
//완벽한 정답이 아닙니다.
3
//정답 1 - cg10036
4
-function fact(n) {
5
- return n ? BigInt(n) * fact(n - 1) : 1n;
6
-}
7
-
8
function solution(n) {
+ const fact = n => n ? BigInt(n) * fact(n - 1) : 1n;
9
return fact(n * 2) / (fact(n) * fact(n + 1));
10
}
0 commit comments