```
class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
for (int idx = triangle.size()-1; idx > 0; idx--)
{
for (int idx1 = 0; idx1 < idx; idx1++)
{
triangle[idx -1][idx1] += min(triangle[idx][idx1],triangle[idx][idx1+1]);
}
}
return triangle[0][0];
}
};
```