Grokking the Art of Recursion for Coding Interviews
Vote
0% completed
16. Fibonacci Series Using Memoization
Problem Statement
Print Fibonacci Series Using Memoization and Recursion.
Given a positive integer n, print the Fibonacci series up to the nth term using memoization and recursion.
Examples:
| Sr# | Input | Output | Explanation |
|---|---|---|---|
| 1 | 5 | 0, 1, 1, 2, 3 | The Fibonacci series up to the 5th term is 0, 1, 1, 2, 3 |
.....
.....
.....
Like the course? Get enrolled and start learning!
Dan Anderson
· 4 months ago
Two issues with this problem:
- The examples are off by 1 relative to the expected output. E.g. For n = 5, the output expects [0,1,1,2,3,5] which is different than the [0,1,1,2,3] shown in the examples.
- The example solution on the next page returns the nth Fibonacci number, not the series which is required by this problem.