Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def fibonacci(n)
return n if ( 0..1 ).include? n
(fibonacci(n - 1) + fibonacci( n - 2 ))
end
start = Time.now
fibonacci(22)
p Time.now - start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment