It shows the following runtime error: Your submission stopped because of a runtime error. Ex: division by zero, array index out of bounds, uncaught exception You can try testing your code with custom input and try putting debug statements in your code.
Your submission encountered runtime error for the following input:
My code :
int Solution::uniquePaths(int A, int B) {
vector< vector < int > > V ;
int i, j;
for( i = 0; i <A ; i++){
for( j =0 ; j< B ; j++){
V[i][j] = 0;
}
}
for ( i = 0 ; i< A ; i++){
V[i][0] = 1;
}
for ( j = 0 ; j< B ; j++){
V[0][j] = 1;
}
for ( i = 1 ; i< A ; i++){
for( j = 1 ; i<B; j++){
V[i][j] = V[i-1][j] + V[i][j-1];
}
}
return V[A-1][B-1];
}