recursive_nth_fibonacci

Ahmed Magdy · @a7madM · almost 3 years

calculates nth fibonacci recursively

def recursive_nth_fibonacci(num)
return 1 if num < 2
return recursive_nth_fibonacci(num - 1) + recursive_nth_fibonacci(num - 2)
end
1 · 0 · 1