Created
January 19, 2020 09:52
-
-
Save nikolay/59431fc8e9798d12402891f957024e98 to your computer and use it in GitHub Desktop.
stepways
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
import sys | |
def stepways(n): | |
return n if n < 4 else stepways(n - 2) + stepways(n - 1) | |
print(stepways(int(sys.argv[1]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment