-
-
Save anonymous/30816517dffe93ae9537 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
Rabbit jumps upstairs. | |
N - number of steps that rabbit can jump at one time | |
X - total steps in stairs | |
N >= 1 | |
X <= 300 | |
N <= X | |
====== | |
if x == 6 and n == 3 | |
there will be 14 unique routes. | |
what if x == 17 and n == 5 ? :) | |
1 + 1 + 1 + 1 + 1 + 1 | |
2 + 1 + 1 + 1 + 1 | |
1 + 2 + 1 + 1 + 1 | |
1 + 1 + 2 + 1 +1 | |
1 + 1 + 1 + 2 + 1 | |
1 + 1 + 1 + 1 + 2 | |
3 + 1 + 1 + 1 | |
1 + 3 + 1 + 1 | |
1 + 1 + 3 + 1 | |
1 + 1 + 1 + 3 | |
3 + 2 + 1 | |
2 + 3 + 1 | |
1 + 2 + 3 | |
1 + 3 + 1 | |
3 + 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment