1
class Solution {
2
public List<Integer> getRow(int rowIndex) {
3
List<List<Integer>> out = new ArrayList<>();
4
for (int i = 0; i <= rowIndex; i++) {
5
List<Integer> in = new ArrayList<>(i + 1);
6
for (int j = 0; j <= i; j++) {
7
if (j == 0 || j == i) {
8
in.add(1);
9
} else {
10
in.add(out.get(i - 1).get(j - 1) + out.get(i - 1).get(j));
11
}
12
}
13
out.add(in);
14
}
15
return out.get(rowIndex);
16
}
17
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0