Solution Review: Return Sequence of Fibonacci Numbers
This lesson discusses how you can use iterators to return return a Fibonacci sequence.
We'll cover the following...
Solution:
The first and second elements of the Fibonacci sequence are 0 and 1 respectively. Each successive element is obtained by adding the two elements before it. For instance, the 3rd element is obtained by adding the 1st and 2nd elements, the 4th is obtained by adding the 2nd and 3rd elements, and so on. Thus we can conclude the following for myArray
in a Fibonacci sequence:
...