/*time complexity is O(rc)*/

'''

class Solution {

public int uniquePaths(int r, int c) {

int[][] arr=new int[r][c];

arr[0][0]=1;

for(int i=0;i<r;i++){

for(int j=0;j<c;j++){

if(j>0){

arr[i][j]+=arr[i][j-1];

}

if(i>0){

arr[i][j]+=arr[i-1][j];

}

}

}

return arr[r-1][c-1];

}

}

'''