Input: numRows = 5
Output: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
Input: numRows = 1
Output: [[1]]
func generate(numRows int) [][]int {
res := [][]int{{1}}
for i := 2; i <= numRows; i++ {
temp := []int{1}
for j := 1; j < i-1; j++ {
temp = append(temp, res[len(res)-1][j]+res[len(res)-1][j-1])
}
temp = append(temp, 1)
res = append(res, temp)
}
return res
}