Skip to content

Instantly share code, notes, and snippets.

@jitsceait
Last active August 29, 2015 14:00
Show Gist options
  • Save jitsceait/dd4d417720736cf6ce9c to your computer and use it in GitHub Desktop.
Save jitsceait/dd4d417720736cf6ce9c to your computer and use it in GitHub Desktop.
Code snippet for recursive solution
int PossiblePaths(int i,int j, int m, int n){
if(i > m || j > n) return 0;
if(i == m && j == n) return 1;
return PossiblePaths(i+1,j, m,n)
+ PossiblePaths(i, j+1, m,n)
+ PossiblePaths(i+1, j+1,m,n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment