14 May 2024 Shift 1 — Fibonacci Series

E · easyP · Verified PYQmathseries

Find the Nth Fibonacci number. F(1)=1, F(2)=1, F(N)=F(N-1)+F(N-2).

Input
10
Output
55
Iterative DP: a=1, b=1, loop from 3 to N: c=a+b, a=b, b=c. Return b.
14 May 2024 Shift 2 — Pattern: Right-Angle Triangle of Numbers →
Report an issue with this question