Created
June 13, 2022 09:25
-
-
Save maysam/1b26bc699074ed0f0d29475998e4d577 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
@answers = {0 => 0, 1 => 1} | |
def fibonnaci(n) | |
return 0 if n < 0 | |
@answers[n] ||= fibonnaci(n-1) + fibonnaci(n-2) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment