Lang: C++; Complexity[Time, Space]: [O(m*n), O(n)]


#1

Gives bonus points too

int Solution::minimumTotal(vector<vector<int> > &A) 
{
    int rows=A.size();
    
    vector<int> dp(A.back());
    for(int r=rows-2; 0<=r; r--)
        for(int c=0; c<A[r].size(); c++)
            dp[c]=A[r][c]+min(dp[c],dp[c+1]);

    return dp.front();
}