(int rowIndex)
| 14 | */ |
| 15 | public class Solution { |
| 16 | public List<Integer> getRow(int rowIndex) { |
| 17 | List<Integer> res = new ArrayList<>(); |
| 18 | for (int i = 0; i <= rowIndex; ++i) { |
| 19 | res.add(1); |
| 20 | for (int j = i - 1; j > 0; --j) { |
| 21 | res.set(j, res.get(j - 1) + res.get(j)); |
| 22 | } |
| 23 | } |
| 24 | return res; |
| 25 | } |
| 26 | |
| 27 | public static void main(String[] args) { |
| 28 | Solution solution = new Solution(); |