Complete the function fibonacci to return an array containing the first N Fibonacci numbers.
fib(n) = n , n <= 1
fib(n) = fib(n-2) + fib(n-1), otherwise
Constraints:
1 ≤ N ≤ 10
Sample Input
4
Sample Output
0
1
1
2
Explanation
fib(0) = 0 by definition
fib(1) = 1
fib(2) = fib(0) + fib(1) = 0 + 1 = 1
fib(3) = fib(1) + fib(2) = 1 + 1 = 2
Download Test Case