Skip to content

Commit 63919d2

Browse files
Update level-4/올바른-괄호의-갯수&12929&.js
Co-authored-by: codeisneverodd <[email protected]>
1 parent 15a9754 commit 63919d2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//https://github.com/codeisneverodd/programmers-coding-test
22
//완벽한 정답이 아닙니다.
33
//정답 1 - cg10036
4-
function fact(n) {
5-
return n ? BigInt(n) * fact(n - 1) : 1n;
6-
}
7-
84
function solution(n) {
5+
const fact = n => n ? BigInt(n) * fact(n - 1) : 1n;
96
return fact(n * 2) / (fact(n) * fact(n + 1));
107
}

0 commit comments

Comments
 (0)