You are viewing a single comment's thread. Return to all comments →
I implemented your logic but some of test cases are failing. Can you please point out mistake in this.
int solve(int n, int m) { int i,j; int arr[n][m]={0};
for(i=0; i<n; i++) { for(j=0; j<m; j++) { if(i == 0 || j == 0) arr[i][j] = 1; else arr[i][j] = arr[i][j-1] + arr[i-1][j]; } } return arr[n-1][m-1];
}
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Tracing
You are viewing a single comment's thread. Return to all comments →
I implemented your logic but some of test cases are failing. Can you please point out mistake in this.
int solve(int n, int m) { int i,j; int arr[n][m]={0};
}