You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea of get is to copy the state to the output field, so we may work on it or just return it (or say, pure it, if you like). As the state is of type (int, int), the output field is of the same type now. So, when we flatMap on it, we are coping with a (int, int) input.
The fib sequence starts with 0, 1. If you change the initial state to 2, 3, you have a sequence like 2, 3, 5, 8, 13, 21, 34, 55, ... . So you get the 8th num in this sequence, which is 55, although you may say that it's the 11th fib number as well.
Note: the fib seq here starts from 0 and 1, and fib(n) means the (n+1)-th fib number because we index from 0.
in fib section:
and later part:
The text was updated successfully, but these errors were encountered: