Created
January 4, 2020 11:48
-
-
Save inspirit941/b243e676b2ef5f671618dc47656446f5 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
def solution(n): | |
table = dict() | |
table[0], table[1] = 1, 1 | |
for i in range(2, n+1): | |
table[i] = table[i-1] + table[i-2] | |
return table[n] % 1234567 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment