Skip to content

Instantly share code, notes, and snippets.

View alexanderlarson's full-sized avatar

Alexander Larson alexanderlarson

View GitHub Profile
@alexanderlarson
alexanderlarson / Fibrec
Created August 16, 2013 04:10
Recursive (slow) solution to Fibonacci validation exercise
def fibonacci(n)
if n <= 1
n
else
fibonacci(n-1) + fibonacci(n-2)
end
end
def isFibonacci(soughtNumber)
return isFibonacci?(soughtNumber, 1)