Created
October 13, 2015 14:50
-
-
Save mindaslab/3813d222e09e414dac13 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
memo = [] | |
(0..n).each do |i| | |
memo[i] = i < 2 ? i : memo[i-1] + memo[i-2] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment