C++ Solution using simple maths


#1
int binomialCoeff(int n, int k){  
    if (k == 0 || k == n)  
        return 1;
    return binomialCoeff(n - 1, k - 1) + binomialCoeff(n - 1, k);  
} 

int Solution::uniquePaths(int A, int B) {
    return binomialCoeff(A+B-2, max(A,B)-1);
}