My solution for Unique Paths


  • 0
    T



    int uniquePaths(int m, int n) {
    long long r;
    int x;
    if(m>n){x=m;m=n;n=x;}
    r = 1;
    for(x=1;x<m;x++) r=r*(n+x-1)/x;
    return (int)r;
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.