재귀 풀이
int fib(int n){
if(n==0) return 0;
else if(n==1) return 1;
else return (fib(n-1) + fib(n-2) % 1234567);
}
int solution(int n) {
int answer = 0;
answer = fib(n);
return answer;
}
dp
int solution(int n) {
int answer = 0;
int F[100001];
F[0] = 0; F[1] = 1;
for(int i=2; i<=n; i++){
F[i] = (F[i-1] + F[i-2] ) % 1234567;
}
answer = F[n];
return answer;
}