Skip to content

Instantly share code, notes, and snippets.

@inspirit941
Created January 4, 2020 11:48
Show Gist options
  • Save inspirit941/b243e676b2ef5f671618dc47656446f5 to your computer and use it in GitHub Desktop.
Save inspirit941/b243e676b2ef5f671618dc47656446f5 to your computer and use it in GitHub Desktop.
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