Created
April 2, 2016 18:57
-
-
Save jayshenk/a6774299581caebcb523884d2e2fee25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fibonacci | |
def self.nth(number) | |
fibo = [1, 1] | |
while fibo.size < number | |
fibo << fibo[-2] + fibo[-1] | |
end | |
fibo.last | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment