{"id":2575,"date":"2022-02-03T20:43:16","date_gmt":"2022-02-03T12:43:16","guid":{"rendered":"http:\/\/139.9.1.231\/?p=2575"},"modified":"2022-02-03T20:43:17","modified_gmt":"2022-02-03T12:43:17","slug":"leetcodeday119","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2022\/02\/03\/leetcodeday119\/","title":{"rendered":"leetcodeday119&#8211;\u6768\u8f89\u4e09\u89d2 II"},"content":{"rendered":"\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u975e\u8d1f\u7d22\u5f15&nbsp;<code>rowIndex<\/code>\uff0c\u8fd4\u56de\u300c\u6768\u8f89\u4e09\u89d2\u300d\u7684\u7b2c&nbsp;<code>rowIndex<\/code>\u884c\u3002<\/p>\n\n\n\n<p><small>\u5728\u300c\u6768\u8f89\u4e09\u89d2\u300d\u4e2d\uff0c\u6bcf\u4e2a\u6570\u662f\u5b83\u5de6\u4e0a\u65b9\u548c\u53f3\u4e0a\u65b9\u7684\u6570\u7684\u548c\u3002<\/small><\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-24.png\" alt=\"\" class=\"wp-image-2577\" width=\"340\" height=\"264\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-24.png 588w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-24-300x233.png 300w\" sizes=\"(max-width: 340px) 100vw, 340px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>\u8f93\u5165:<\/strong> rowIndex = 3\n<strong>\u8f93\u51fa:<\/strong> &#91;1,3,3,1]<\/code><\/pre>\n\n\n\n<p><strong>\u793a\u4f8b 2:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>\u8f93\u5165:<\/strong> rowIndex = 0\n<strong>\u8f93\u51fa:<\/strong> &#91;1]<\/code><\/pre>\n\n\n\n<p><strong>\u793a\u4f8b 3:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>\u8f93\u5165:<\/strong> rowIndex = 1\n<strong>\u8f93\u51fa:<\/strong> &#91;1,1]<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># @lc app=leetcode.cn id=119 lang=python3\r\n#\r\n# &#91;119] \u6768\u8f89\u4e09\u89d2 II\r\n#\r\n\r\n# @lc code=start\r\nclass Solution:\r\n    def getRow(self, rowIndex: int) -> List&#91;int]:\r\n        nums=&#91;]\r\n        for i in range(rowIndex+1):\r\n            if i==0:\r\n                nums=&#91;1]\r\n            elif i==1:\r\n                nums=&#91;1,1]\r\n            else:\r\n                m=list()\r\n                for j in range(len(nums)-1):\r\n                    m.append(nums&#91;j]+nums&#91;j+1])\r\n                nums=&#91;1]+m+&#91;1]\r\n        return nums\r\n# @lc code=end\r\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" width=\"828\" height=\"203\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-23.png\" alt=\"\" class=\"wp-image-2576\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-23.png 828w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-23-300x74.png 300w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-23-768x188.png 768w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/02\/image-23-825x203.png 825w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed9\u5b9a\u4e00\u4e2a\u975e\u8d1f\u7d22\u5f15&nbsp;rowIndex\uff0c\u8fd4\u56de\u300c\u6768\u8f89\u4e09\u89d2\u300d\u7684\u7b2c&nbsp;rowIndex\u884c\u3002 \u5728\u300c\u6768\u8f89\u4e09 &hellip; <a href=\"http:\/\/139.9.1.231\/index.php\/2022\/02\/03\/leetcodeday119\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">leetcodeday119&#8211;\u6768\u8f89\u4e09\u89d2 II<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2575"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=2575"}],"version-history":[{"count":1,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2575\/revisions"}],"predecessor-version":[{"id":2578,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2575\/revisions\/2578"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=2575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=2575"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=2575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}