Skip to content

Commit ecfb8ca

Browse files
authored
[20251103] PGM / LV2 / 2xn 타일링 / 이인희
1 parent d3a178a commit ecfb8ca

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```java
2+
class Solution {
3+
public int solution(int n) {
4+
long[] dp = new long[60001];
5+
dp[0] = 0;
6+
dp[1] = 1;
7+
dp[2] = 2;
8+
for(int i = 3; i <= n; i++){
9+
dp[i] = (dp[i-1] + dp[i-2]) % 1000000007;
10+
}
11+
return (int)dp[n];
12+
}
13+
}
14+
```

0 commit comments

Comments
 (0)