美文网首页
Leetcode 119. Pascal's Triangle

Leetcode 119. Pascal's Triangle

作者: 我是小邓 | 来源:发表于2017-07-21 21:57 被阅读0次

    神TM 的杨辉三角 又是一道数学题

    1. 不能从前遍历,因为这里只要输出一行的 ,会被覆盖

    所以要从后面遍历。

    所以第二个for循环 for(int j = res.size()-2

    第一个for循环是要从1开始 因为 第一个数是1 前面已经added

    2. list的属性 get    set (index , object)

    相关文章

      网友评论

          本文标题:Leetcode 119. Pascal's Triangle

          本文链接:https://www.haomeiwen.com/subject/dawqkxtx.html