Very simple constant space C++ solution


#1

No need to form a separate DP array.

int Solution::minimumTotal(vector<vector<int> > &A) {
        if(A.size() == 1){
            return A[0][0];
        }
        
        for(int i=A.size()-2; i>=0; i--){
            for(int j=0; j<A[i].size(); j++){
                A[i][j] += min(A[i+1][j], A[i+1][j+1]);
            }
        }
        
        return A[0][0];
    }