O(m*n) Time and O(m) space


  • 0
    N
            if(m==0||n==0)    return 0;
            vector<int> aux(n,1);
            for(int i=1;i<m;i++)
            {
                for(int j=0;j<n;j++)
                {
                    if(i>0) aux[j]+=aux[j-1];
                }
                
            }
            return aux[n-1];
        }```

Log in to reply
 

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