#include using namespace std; class Solution { public: vector getRow(int rowIndex) { vector lastRow{1}; for (int i = 1; i < rowIndex + 1; i++) { vector currentRow(i + 1, 0); currentRow[0] = 1; currentRow[i] = 1; for (int j = 1; j < i; j++) { currentRow[j] = lastRow[j - 1] + lastRow[j]; } lastRow = currentRow; } return lastRow; } };