Fibonacci numbers... haha.
Utilisateur anonyme
It can be done in O(logN) time is you are really clever. O(n) is the standard iterative answer, if you cache the last two calculations. If you gave the recursive answer, O(2^N), then that is why you failed.