We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cfd71e4 commit dd26705Copy full SHA for dd26705
LiiNi-coder/202510/26 PGM 멀리 뛰기.md
@@ -0,0 +1,19 @@
1
+```java
2
+class Solution {
3
+ private static long[] dp;
4
+ public long solution(int n) {
5
+ dp = new long[n + 1];
6
+ dp[1] = 1;
7
+ if (n >= 2)
8
+ dp[2] = 2;
9
+ return getDp(n);
10
+ }
11
+
12
+ private long getDp(int n) {
13
+ if (dp[n] != 0) return dp[n];
14
+ dp[n] = (getDp(n - 1) + getDp(n - 2)) % 1234567;
15
+ return dp[n];
16
17
+}
18
19
+```
0 commit comments