(int rowIndex)
| 3 | class Solution { |
| 4 | |
| 5 | public List<Integer> getRow(int rowIndex) { |
| 6 | List<Integer> ans = new ArrayList<>(); |
| 7 | int[][] dp = new int[rowIndex + 1][rowIndex + 1]; |
| 8 | for (int i = 0; i <= rowIndex; i++) { |
| 9 | ans.add(value(rowIndex, i, dp)); |
| 10 | } |
| 11 | return ans; |
| 12 | } |
| 13 | |
| 14 | public int value(int row, int col, int[][] dp) { |
| 15 | if (row == 0 || col == 0 || col == row) return 1; |