Registrations for the November 2021 System Design Cohort are now open Enroll Today

IWGBS Solution



N = int (input());
A = [0,1];
B = [0,1];
i = 2;
while i <= N:
    a = A[i-1]+B[i-1];
    A.append(a);
    B.append(A[i-1]);
    i = i+1;
print(A[N]+B[N]);

470+ Competitive Programming Solutions

If you like what you read subscribe to my newsletter.

I write essays on various engineering topics and share it through my weekly newsletter 👇