Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 63919d2

Browse files
cg10036codeisneverodd
andauthored
Update level-4/올바른-괄호의-갯수&12929&.js
Co-authored-by: codeisneverodd <codeisneverodd@gmail.com>
1 parent 15a9754 commit 63919d2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed
Lines changed: 1 addition & 4 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /