Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution{
- long numberOfPaths(int M, int N) {
- if ((M == 1) || (N == 1)) {
- return 1;
- }
- return numberOfPaths(M - 1, N) + numberOfPaths(M, N - 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement