public static long[] fibGood(int n) {
if (n < = 1) {
long[] answer = {n,0};
return answer;
} else {
long[] tmp = fibGood(n-1);
long[] answer = {tmp[0] + tmp[1], tmp[0]};
return answer;
}
}
You will have the answer for fibGood(n) in fibGood(n)[0]
No comments:
Post a Comment
With great power comes great responsibility