Easiets c++ recursion solution.....just keep in mind that the same stuff is repeated again and again and hence use recursion


#1

int sumpath(int i,int j,int A,int B)
{
if(i==B)
return 1;
else if (j==A)
return 1;
else
return (sumpath(i+1,j,A,B)+sumpath(i,j+1,A,B));

}
int Solution::uniquePaths(int A, int B) {
return (sumpath(1,1,A,B)); // calliing recursive solutuon

}