Fibonacci
Track only the previous two numbers and iterate until you reach n. This keeps the solution clear and avoids exponential recursion.
Return the nth Fibonacci number.
Track only the previous two numbers and iterate until you reach n. This keeps the solution clear and avoids exponential recursion.
Track only the previous two numbers and iterate until you reach n. This keeps the solution clear and avoids exponential recursion.
Return the nth Fibonacci number.