public class Solution {
public List<Integer> getRow(int rowIndex) {
List<Integer> rl=new ArrayList<Integer>();
int[] triArray=new int[rowIndex+1];
for(int i=0;i<rowIndex+1;++i){
for(int j=i;j>=0;--j){
if(j==i){
triArray[i]=1;
}else if(j==0){
triArray[0]=1;
}else{
triArray[j]=triArray[j]+triArray[j-1];
}
}
}
for(int k=0;k<rowIndex+1;++k){
rl.add(triArray[k]);
}
return rl;
}
}
public List<Integer> getRow(int rowIndex) {
List<Integer> rl=new ArrayList<Integer>();
int[] triArray=new int[rowIndex+1];
for(int i=0;i<rowIndex+1;++i){
for(int j=i;j>=0;--j){
if(j==i){
triArray[i]=1;
}else if(j==0){
triArray[0]=1;
}else{
triArray[j]=triArray[j]+triArray[j-1];
}
}
}
for(int k=0;k<rowIndex+1;++k){
rl.add(triArray[k]);
}
return rl;
}
}