I\'m trying to implement the following function, but it keeps giving me the stack level too deep (SystemStackError) error.
stack level too deep (SystemStackError)
Any ideas what the problem mi
We can perform list fibo series using below algorithm
def fibo(n) n <= 2 ? 1 : fibo(n-1) + fibo(n-2) end
We can generate series like below
p (1..10).map{|x| fibo(x)}
below is the output of this
=> [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]