Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. def numWays(N):
  2.     if (N == 1):
  3.         return 1;
  4.     else if (N==2):
  5.         return 2;
  6.     else if (N==3):
  7.         return 4;
  8.     else:
  9.         return numWays(N-1) + numWays(N-2) + numWays(N-3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement