public class Solution {
public int Fibonacci(int n) {
int[] array = new int[40] ;
array[1] = 1;
array[2] = 1;
for (int i = 3; i <= n; i++)
array[i] = array[i-1] + array[i-2];
return array[n];
}
}
05-25