Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def numWays(N):
- if (N == 1):
- return 1;
- else if (N==2):
- return 2;
- else if (N==3):
- return 4;
- else:
- return numWays(N-1) + numWays(N-2) + numWays(N-3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement