{"id":1158,"date":"2023-05-03T12:31:20","date_gmt":"2023-05-03T04:31:20","guid":{"rendered":"https:\/\/white-night.club\/?p=1158"},"modified":"2023-11-09T11:07:55","modified_gmt":"2023-11-09T03:07:55","slug":"ad9","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/05\/03\/ad9\/","title":{"rendered":"\u5251\u6307 Offer 25.\u00a0\u5408\u5e76\u4e24\u4e2a\u6392\u5e8f\u7684\u94fe\u8868"},"content":{"rendered":"\n<p>\u8f93\u5165\u4e24\u4e2a\u9012\u589e\u6392\u5e8f\u7684\u94fe\u8868\uff0c\u5408\u5e76\u8fd9\u4e24\u4e2a\u94fe\u8868\u5e76\u4f7f\u65b0\u94fe\u8868\u4e2d\u7684\u8282\u70b9\u4ecd\u7136\u662f\u9012\u589e\u6392\u5e8f\u7684\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>1-&gt;2-&gt;4, 1-&gt;3-&gt;4\n<strong>\u8f93\u51fa\uff1a<\/strong>1-&gt;1-&gt;2-&gt;3-&gt;4-&gt;4<\/pre>\n\n\n\n<p><strong>\u9650\u5236\uff1a<\/strong><\/p>\n\n\n\n<p><code>0 &lt;= \u94fe\u8868\u957f\u5ea6 &lt;= 1000<\/code><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>\u521d\u59cb\u4ee3\u7801<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#00ff2f\" class=\"has-inline-color\">\/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode(int x) : val(x), next(NULL) {}\n * };\n *\/<\/mark>\nclass Solution {\npublic:\n    ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {\n\n    }\n};<\/code><\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>\u9012\u5f52<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u91cd\u65b0\u5199\u4e86\u904d\u8fd9\u9898\uff0c\u53d1\u73b0\u81ea\u5df1\u8fd8\u662f\u6709\u4e9b\u5730\u65b9\u6ca1\u5f04\u61c2\u3002<\/p>\n\n\n\n<p>\u4e3b\u8981\u662f\u62fc\u63a5\u94fe\u8868\u90a3\u5757\u3002\u94fe\u8868\u6700\u540e\u8fd4\u56de\u7684\u5934\u8282\u70b9\u53ef\u80fd\u662fl1\u4e5f\u53ef\u80fd\u662fl2\u3002\u4f46\u6211\u4eec\u5229\u7528\u9012\u5f52\u5c31\u80fd\u7701\u53bb\u76f8\u5e94\u7684\u5224\u65ad\u3002<\/p>\n\n\n\n<p>\u76f4\u63a5\u770b\u4e00\u4e0b\u6781\u7aef\u7684\u60c5\u51b5\u3002\u5047\u8bbeL1\u4e2d\u7684\u5143\u7d20\u90fd\u6bd4L2\u5c0f\u3002\u90a3\u4e48\u76f8\u5f53\u4e8e\u4e00\u76f4\u9012\u5f52L1\uff0c\u76f4\u5230L1\u4e3a\u7a7a\u3002\u5e76\u5728\u6b64\u65f6\u8fd4\u56deL2\u7ed9L1-&gt;next,\u76f8\u5f53\u4e8e\u628aL2\u7684\u5168\u90e8\u5143\u7d20\u63a5\u5230L1\u7684\u5c3e\u8282\u70b9\u4e4b\u540e\u3002\u53cd\u4e4b\u540c\u7406\u3002<\/p>\n\n\n\n<p>\u518d\u770b\u4e0b\u6ca1\u90a3\u4e48\u6781\u7aef\u7684\u60c5\u51b5\u3002\u76f8\u5f53\u4e8e\u8c01\u5c0f\u5c31\u9012\u5f52\u8c01\uff0cL1\u5c0f\u5c31\u9012\u5f52L1\uff0cL2\u5c0f\u6216\u8005L1\u548cL2\u76f8\u7b49\u5c31\u9012\u5f52L2\u3002\u6700\u540e\u8fd4\u56de\u7684\u65f6\u5019\u8c01\u88ab\u62fc\u4e0a\u8282\u70b9\u5c31\u8fd4\u56de\u8c01\u3002<\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>\u5b8c\u6574\u4ee3\u7801<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#00ff2f\" class=\"has-inline-color\">\/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode(int x) : val(x), next(NULL) {}\n * };\n *\/<\/mark>\nclass Solution {\npublic:\n    ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {\n        if(l1==NULL||l2==NULL)\n            return l1==NULL ? l2:l1;\n        if(l1->val&lt;l2->val){\n            l1->next=mergeTwoLists(l1->next,l2);\n            return l1;\n        }\n        else\n        {\n            l2->next=mergeTwoLists(l1,l2->next);\n            return l2;\n        }\n           \n    }\n};<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>LeetCode\u9898\u76ee\uff1a\u9012\u5f52<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/1158"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=1158"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/1158\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=1158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=1158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=1158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}