O(1) Space Solution ;)


#1

int Solution::minimumTotal(vector<vector > &a) {

int n = a.size();

int cnt = a[n-2].size();

for(int i = n - 2; i >= 0; i--){
    for(int j = 0; j < cnt; j++){
        a[i][j] += min({ a[i+1][j], a[i+1][j+1] });
    }
    cnt -= 1;
}
return a[0][0];

}