Skip to content

Commit 7e543e1

Browse files
committed
103차 3번 문제풀이
1 parent 0670f63 commit 7e543e1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function solution(n) {
2+
const dp = [];
3+
dp[0] = 0;
4+
dp[1] = 1;
5+
dp[2] = 2;
6+
// dp[3] = 3;
7+
// dp[4] = 5;
8+
// dp[5] = 8;
9+
// dp[6] = 13;
10+
for (let i = 3; i <= n; i++) dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
11+
12+
return dp[n];
13+
}
14+
15+
console.log(solution(6));

0 commit comments

Comments
 (0)