Cody

Problem 1997. Compute Fibonacci Number

Solution 2593195

Submitted on 21 Jun 2020 by hassan ashraf
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(fibonacci(1),1)) assert(isequal(fibonacci(2),1)) assert(isequal(fibonacci(5),5)) assert(isequal(fibonacci(7),13)) assert(isequal(fibonacci(13),233)) assert(isequal(fibonacci(15),610))

f = 1 f = 1 t = 1 t = 1 1 t = 1 1 2 t = 1 1 2 3 t = 1 1 2 3 5 f = 5 t = 1 t = 1 1 t = 1 1 2 t = 1 1 2 3 t = 1 1 2 3 5 t = 1 1 2 3 5 8 t = 1 1 2 3 5 8 13 f = 13 t = 1 t = 1 1 t = 1 1 2 t = 1 1 2 3 t = 1 1 2 3 5 t = 1 1 2 3 5 8 t = 1 1 2 3 5 8 13 t = 1 1 2 3 5 8 13 21 t = 1 1 2 3 5 8 13 21 34 t = 1 1 2 3 5 8 13 21 34 55 t = 1 1 2 3 5 8 13 21 34 55 89 t = 1 1 2 3 5 8 13 21 34 55 89 144 t = 1 1 2 3 5 8 13 21 34 55 89 144 233 f = 233 t = 1 t = 1 1 t = 1 1 2 t = 1 1 2 3 t = 1 1 2 3 5 t = 1 1 2 3 5 8 t = 1 1 2 3 5 8 13 t = 1 1 2 3 5 8 13 21 t = 1 1 2 3 5 8 13 21 34 t = 1 1 2 3 5 8 13 21 34 55 t = 1 1 2 3 5 8 13 21 34 55 89 t = 1 1 2 3 5 8 13 21 34 55 89 144 t = 1 1 2 3 5 8 13 21 34 55 89 144 233 t = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 t = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 f = 610