代码:
class Solution {
public List<Integer> getRow(int rowIndex) {
List<Integer> res = new ArrayList<>();
int arr[][] = new int[rowIndex+1][rowIndex+1];
for(int i=0;i<rowIndex+1;i++){
arr[i][0] = 1;
arr[i][i] = 1;
for(int j=1;j<i;j++){
arr[i][j] = arr[i-1][j-1]+arr[i-1][j];
}
}
for(int i=0;i<rowIndex+1;i++){
res.add(arr[rowIndex][i]);
}
return res;
}
}