
给定一个非负整数 numRows,生成「杨辉三角」的前 numRows 行。
在「杨辉三角」中,每个数是它左上方和右上方的数的和。
public class Solution {
    public IList<IList<int>> Generate(int numRows) {
        List<IList<int>> res = new List<IList<int>>();
        for(int i = 0; i < numRows; i++)
        {
            List<int> temp = new List<int>();
            for(int j = 0; j <= i; j++)
            {
                if(j == 0 || j == i)
                    temp.Add(1);
                else
                    temp.Add(res[i - 1][j - 1] + res[i - 1][j]);
            }
            res.Add(temp);
        }
        return res;
    }
}


















