Fibonacci Sums Ruby

[Solved] Fibonacci Sums Ruby | Ruby - Code Explorer | yomemimo.com
Question : fibonacci sums ruby

Answered by : edmond-hui

# Write a method that finds the sum of the first n fibonacci numbers recursively.
# Assume n > 0.
def fibs_sum(n) return 1 if n == 1 return 2 if n == 2 n + fibs_sum(n-1)
end

Source : | Last Update : Sat, 31 Oct 20

Answers related to fibonacci sums ruby

Code Explorer Popular Question For Ruby