classSolution{ funcgetRow(_rowIndex: Int) -> [Int] { if rowIndex ==0 { return [1] } var res = [Int]() var row = [Int]() for i in1... rowIndex { for j in0... i { if j ==0|| j == i { row.append(1) }else{ row.append(res[j-1] + res[j]) } } res = row row = [] } return res } }