14 May 2024 Shift 1 — Fibonacci Series
E · easyP · Verified PYQmathseries
Problem
Find the Nth Fibonacci number. F(1)=1, F(2)=1, F(N)=F(N-1)+F(N-2).
Example
Input
10
Output
55
Iterative DP: a=1, b=1, loop from 3 to N: c=a+b, a=b, b=c. Return b.
Find the Nth Fibonacci number. F(1)=1, F(2)=1, F(N)=F(N-1)+F(N-2).
10
55
Local Storage Only
Your progress is saved securely in your browser. No account needed. (If you clear data or switch devices, progress resets).