[CTCI] Fobonacci Problem
The problem is well known, so there is no need to repeat it!
we can apply the iteration function f(n+1) = f(n)+f(n-1), however the time complexity is O(N).
We can reduce the time compexity to O(log(N)) using the method below.
f(1)=1,f(2)=1
$\begin{matrix}
f(n)&f(n-1)&\\
0& 0\\
\end{matrix}$