public class Solution { public IListGetRow(int rowIndex) { if(rowIndex == 0){ return new List (){1}; } if(rowIndex == 1){ return new List (){1,1}; } var list = new List (){1,1}; for(var i = 1;i < rowIndex; i++){ var r = new List (); r.Add(1); for(var j = 0;j < list.Count - 1; j++){ r.Add(list[j] + list[j+1]); } r.Add(1); list = r; } return list; } }