Algorithm Puzzles: Fibonacci Number
Algorithm Puzzles everyday every week sometimes: Fibonacci Number
Puzzle
Puzzle from leetcode:
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1.
Solution
1 | class Solution { |
T.C.: O(N)