Skip to content

Commit e767940

Browse files
authored
[20251016] PGM / Lv2 / 피보나치 / 이종환
1 parent 754cc21 commit e767940

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```java
2+
class Solution {
3+
static final int REMAINDER = 1234567;
4+
5+
public int solution(int n) {
6+
int[] fibo = new int[100001];
7+
fibo[1] = 1;
8+
9+
for (int i = 2; i <= 100000; i++){
10+
fibo[i] = fibo[i-1] + fibo[i-2];
11+
fibo[i] %= REMAINDER;
12+
}
13+
14+
int answer = fibo[n];
15+
16+
return answer;
17+
}
18+
}
19+
```

0 commit comments

Comments
 (0)