class Solution {
public List<List<Integer>> generate(int numRows) {
List<List<Integer>> list = new ArrayList<>();
for(int i = 0; i < numRows; i++){
list.add(new ArrayList<>());
list.get(i).add(1);
if(i == 1){
list.get(i).add(1);
}else if(i >= 2){
for(int j = 1 ; j < i; j++){
list.get(i).add(list.get(i-1).get(j-1) + list.get(i-1).get(j));
}
list.get(i).add(1);
}
}
return list;
}
}