{"id":99262,"date":"2026-09-02T09:32:55","date_gmt":"2026-09-02T01:32:55","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99262.html"},"modified":"2026-09-02T09:32:55","modified_gmt":"2026-09-02T01:32:55","slug":"%e5%8f%8c%e6%8c%87%e9%92%88%e7%ae%97%e6%b3%95-%e9%a2%98%e8%a7%a3%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99262.html","title":{"rendered":"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3"},"content":{"rendered":"<h3>\u5f15\u5165&#xff1a;\u53cc\u6307\u9488\u5230\u5e95\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898<\/h3>\n<p>\u6211\u76ee\u524d\u5bf9\u201c\u53cc\u6307\u9488\u201d\u7684\u7406\u89e3\u662f&#xff1a;\u5728\u904d\u5386\u6570\u7ec4\u3001\u6570\u5b57\u72b6\u6001\u6216\u5019\u9009\u533a\u95f4\u65f6&#xff0c;\u540c\u65f6\u7ef4\u62a4\u4e24\u4e2a\u4f1a\u79fb\u52a8\u7684\u4f4d\u7f6e&#xff0c;\u5e76\u8ba9\u5b83\u4eec\u627f\u62c5\u4e0d\u540c\u7684\u804c\u8d23\u3002\u8fd9\u6837\u505a\u7684\u4ef7\u503c\u4e0d\u53ea\u662f\u4ee3\u7801\u91cc\u51fa\u73b0\u4e86\u4e24\u4e2a\u53d8\u91cf&#xff0c;\u800c\u662f\u6bcf\u6b21\u79fb\u52a8\u90fd\u80fd\u6839\u636e\u9898\u76ee\u7684\u89c4\u5f8b\u6392\u9664\u4e00\u6279\u4e0d\u53ef\u80fd\u7684\u60c5\u51b5&#xff0c;\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u679a\u4e3e\u3002<\/p>\n<p>\u5f88\u591a\u76f4\u63a5\u679a\u4e3e\u7684\u5199\u6cd5\u4f1a\u4ea7\u751f\u4e24\u5c42\u3001\u4e09\u5c42\u751a\u81f3\u56db\u5c42\u5faa\u73af\u3002\u53cc\u6307\u9488\u5e76\u4e0d\u80fd\u628a\u6240\u6709\u95ee\u9898\u90fd\u53d8\u6210\u7ebf\u6027\u590d\u6742\u5ea6&#xff0c;\u4f46\u5728\u6570\u636e\u6709\u5e8f\u3001\u7ed3\u679c\u5177\u6709\u5355\u8c03\u6027&#xff0c;\u6216\u8005\u6570\u7ec4\u9700\u8981\u539f\u5730\u8bfb\u5199\u65f6&#xff0c;\u5b83\u7ecf\u5e38\u53ef\u4ee5\u628a\u4e00\u90e8\u5206\u91cd\u590d\u641c\u7d22\u538b\u7f29\u6389\u3002<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"456\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902013254-6a977cc65556c.png\" width=\"918\" \/><\/p>\n<p>\u672c\u6587\u6574\u7406\u516b\u9053\u9898&#xff1a;283 \u79fb\u52a8\u96f6\u30011089 \u590d\u5199\u96f6\u3001202 \u5feb\u4e50\u6570\u300111 \u76db\u6700\u591a\u6c34\u7684\u5bb9\u5668\u3001611 \u6709\u6548\u4e09\u89d2\u5f62\u7684\u4e2a\u6570\u3001LCR 179 \u4e24\u6570\u4e4b\u548c\u300115 \u4e09\u6570\u4e4b\u548c\u300118 \u56db\u6570\u4e4b\u548c\u3002\u8303\u56f4\u4e3b\u8981\u96c6\u4e2d\u5728\u56db\u79cd\u6a21\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u540c\u5411\u5feb\u6162\u6307\u9488&#xff1a;\u4e00\u4e2a\u6307\u9488\u8bfb&#xff0c;\u4e00\u4e2a\u6307\u9488\u5199&#xff1b;<\/li>\n<li>\u4ece\u540e\u5411\u524d\u7684\u8bfb\u5199\u6307\u9488&#xff1a;\u907f\u514d\u6269\u5c55\u5199\u5165\u65f6\u8986\u76d6\u8fd8\u6ca1\u6709\u8bfb\u53d6\u7684\u6570\u636e&#xff1b;<\/li>\n<li>\u5feb\u6162\u6307\u9488\u5224\u73af&#xff1a;\u628a\u53cd\u590d\u53d8\u5316\u7684\u6570\u5b57\u72b6\u6001\u770b\u6210\u4e00\u6761\u8def\u7ebf&#xff1b;<\/li>\n<li>\u6392\u5e8f\u540e\u76f8\u5411\u53cc\u6307\u9488&#xff1a;\u6839\u636e\u548c\u7684\u5927\u5c0f\u3001\u9762\u79ef\u4e0a\u9650\u6216\u4e0d\u7b49\u5f0f\u5173\u7cfb\u79fb\u52a8\u5de6\u53f3\u8fb9\u754c\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u7684\u201c\u539f\u5730\u201d\u662f\u6307\u76f4\u63a5\u4fee\u6539\u8f93\u5165\u6570\u7ec4&#xff0c;\u4e0d\u989d\u5916\u521b\u5efa\u4e00\u4e2a\u540c\u7b49\u89c4\u6a21\u7684\u65b0\u6570\u7ec4&#xff1b;\u201c\u53bb\u91cd\u201d\u662f\u6307\u907f\u514d\u540c\u4e00\u4e2a\u7b54\u6848\u56e0\u4e3a\u6570\u7ec4\u4e2d\u51fa\u73b0\u91cd\u590d\u6570\u5b57\u800c\u88ab\u52a0\u5165\u591a\u6b21\u3002\u4e0b\u9762\u6309\u9898\u53f7\u9010\u9898\u6574\u7406\u6211\u5bf9\u6307\u9488\u542b\u4e49\u3001\u79fb\u52a8\u7406\u7531\u548c\u4ee3\u7801\u7ec6\u8282\u7684\u7406\u89e3\u3002<\/p>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u4e00\u3001283. \u79fb\u52a8\u96f6<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u6570\u7ec4 nums&#xff0c;\u5c06\u6570\u7ec4\u4e2d\u7684\u6240\u6709 0 \u79fb\u52a8\u5230\u6570\u7ec4\u672b\u5c3e&#xff0c;\u540c\u65f6\u4fdd\u6301\u975e\u96f6\u5143\u7d20\u539f\u6765\u7684\u76f8\u5bf9\u987a\u5e8f\u3002\u8981\u6c42\u76f4\u63a5\u4fee\u6539\u8f93\u5165\u6570\u7ec4&#xff0c;\u4e5f\u5c31\u662f\u539f\u5730\u5b8c\u6210&#xff0c;\u4e0d\u80fd\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u5b8c\u6574\u6570\u7ec4\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;[0, 1, 0, 3, 12] \u5904\u7406\u540e\u53d8\u4e3a [1, 3, 12, 0, 0]\u3002<\/p>\n<p>\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 283. \u79fb\u52a8\u96f6<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u8fd9\u9053\u9898\u9002\u5408\u540c\u5411\u5feb\u6162\u6307\u9488\u3002\u6211\u7684\u5224\u65ad\u4f9d\u636e\u662f&#xff1a;\u9898\u76ee\u8981\u6c42\u628a\u201c\u6ee1\u8db3\u6761\u4ef6\u7684\u5143\u7d20\u201d\u96c6\u4e2d\u5230\u6570\u7ec4\u524d\u9762&#xff0c;\u540c\u65f6\u4fdd\u7559\u5b83\u4eec\u539f\u6765\u7684\u987a\u5e8f&#xff0c;\u5e76\u4e14\u8981\u6c42\u539f\u5730\u4fee\u6539\u3002<\/p>\n<p>\u53ef\u4ee5\u628a\u4efb\u52a1\u62c6\u6210\u4e24\u6b65&#xff1a;\u5148\u628a\u6240\u6709\u975e\u96f6\u6570\u6309\u539f\u987a\u5e8f\u5199\u5230\u6570\u7ec4\u524d\u9762&#xff0c;\u518d\u628a\u5269\u4f59\u4f4d\u7f6e\u8865\u6210\u96f6\u3002<\/p>\n<ul>\n<li>fast \u662f\u8bfb\u6307\u9488&#xff0c;\u4ece\u5de6\u5230\u53f3\u68c0\u67e5\u6bcf\u4e00\u4e2a\u5143\u7d20&#xff1b;<\/li>\n<li>slow \u662f\u5199\u6307\u9488&#xff0c;\u8868\u793a\u4e0b\u4e00\u4e2a\u975e\u96f6\u5143\u7d20\u5e94\u8be5\u653e\u5728\u54ea\u91cc&#xff1b;<\/li>\n<li>\u6bcf\u8bfb\u5230\u4e00\u4e2a\u975e\u96f6\u5143\u7d20&#xff0c;\u5c31\u5199\u5230 nums[slow]&#xff0c;\u7136\u540e\u8ba9 slow \u5411\u53f3\u79fb\u52a8&#xff1b;<\/li>\n<li>\u5168\u90e8\u626b\u63cf\u7ed3\u675f\u540e&#xff0c;slow \u5de6\u4fa7\u5df2\u7ecf\u653e\u597d\u4e86\u6240\u6709\u975e\u96f6\u5143\u7d20&#xff0c;\u4ece slow \u5f00\u59cb\u5230\u6570\u7ec4\u672b\u5c3e\u5168\u90e8\u586b\u96f6\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u4e0d\u9700\u8981\u5728\u6bcf\u9047\u5230\u4e00\u4e2a\u96f6\u65f6\u642c\u52a8\u540e\u9762\u7684\u6574\u6bb5\u5143\u7d20\u3002\u90a3\u79cd\u505a\u6cd5\u867d\u7136\u5bb9\u6613\u60f3\u5230&#xff0c;\u4f46\u591a\u4e2a\u96f6\u4f1a\u53cd\u590d\u642c\u52a8\u540c\u4e00\u6279\u6570\u636e&#xff0c;\u6700\u574f\u60c5\u51b5\u4e0b\u4f1a\u8fbe\u5230 O(n\u00b2)\u3002\u5feb\u6162\u6307\u9488\u628a\u201c\u5bfb\u627e\u975e\u96f6\u5143\u7d20\u201d\u548c\u201c\u653e\u7f6e\u975e\u96f6\u5143\u7d20\u201d\u5206\u5f00&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u53ea\u88ab\u626b\u63cf\u548c\u5904\u7406\u6709\u9650\u6b21\u3002<\/p>\n<p>slow \u4e0d\u4f1a\u8d85\u8fc7 fast&#xff0c;\u56e0\u6b64\u5199\u5165\u52a8\u4f5c\u4e0d\u4f1a\u8986\u76d6\u53f3\u4fa7\u8fd8\u6ca1\u6709\u8bfb\u5230\u7684\u5143\u7d20\u3002\u5f53 slow \u548c fast \u76f8\u7b49\u65f6&#xff0c;\u5f53\u524d\u975e\u96f6\u5143\u7d20\u76f8\u5f53\u4e8e\u5199\u56de\u539f\u5904&#xff0c;\u4e5f\u4e0d\u4f1a\u6709\u95ee\u9898\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>class Solution {<br \/>\n    public void moveZeroes(int[] nums) {<br \/>\n        int slow &#061; 0;<\/p>\n<p>        for (int fast &#061; 0; fast &lt; nums.length; fast&#043;&#043;) {<br \/>\n            if (nums[fast] !&#061; 0) {<br \/>\n                nums[slow] &#061; nums[fast];<br \/>\n                slow&#043;&#043;;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        while (slow &lt; nums.length) {<br \/>\n            nums[slow] &#061; 0;<br \/>\n            slow&#043;&#043;;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>slow \u521d\u59cb\u4e3a 0&#xff0c;\u8868\u793a\u7b2c\u4e00\u4e2a\u975e\u96f6\u6570\u5e94\u5f53\u5199\u5165\u7684\u4f4d\u7f6e\u3002fast \u626b\u63cf\u5230\u975e\u96f6\u503c\u65f6&#xff0c;nums[slow] &#061; nums[fast] \u5c06\u5b83\u5199\u5165\u5f53\u524d\u5e94\u8be5\u4fdd\u7559\u7684\u533a\u57df&#xff0c;\u7136\u540e slow&#043;&#043; \u4e3a\u4e0b\u4e00\u4e2a\u975e\u96f6\u503c\u9884\u7559\u4f4d\u7f6e\u3002<\/p>\n<p>\u626b\u63cf\u7ed3\u675f\u65f6&#xff0c;\u533a\u95f4 [0, slow) \u4e2d\u5df2\u7ecf\u6309\u539f\u6709\u987a\u5e8f\u653e\u5165\u6240\u6709\u975e\u96f6\u6570\u3002\u8fd9\u91cc\u7684\u53f3\u8fb9\u754c slow \u4e0d\u5305\u542b\u5728\u5df2\u5b8c\u6210\u533a\u57df\u4e2d&#xff0c;\u6240\u4ee5\u4ece slow \u5f00\u59cb\u8865\u96f6\u5373\u53ef\u3002<\/p>\n<p>\u4f8b\u5982\u8f93\u5165 [0, 1, 0, 3, 12]&#xff0c;\u975e\u96f6\u6570\u4f9d\u6b21\u662f 1\u30013\u300112&#xff0c;\u5b83\u4eec\u4f1a\u88ab\u5199\u5230\u4e0b\u6807 0\u30011\u30012&#xff0c;\u6700\u540e\u4e0b\u6807 3\u30014 \u5199\u6210\u96f6\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;O(n)\u3002fast \u626b\u63cf\u6570\u7ec4\u4e00\u6b21&#xff0c;\u8865\u96f6\u6700\u591a\u518d\u626b\u63cf\u4e00\u6b21&#xff0c;\u6574\u4f53\u4ecd\u662f\u7ebf\u6027\u65f6\u95f4\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O(1)&#xff0c;\u53ea\u4f7f\u7528\u4e86\u51e0\u4e2a\u989d\u5916\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u4e2a&#xff1a;<\/p>\n<li>\u975e\u96f6\u5143\u7d20\u5305\u62ec\u8d1f\u6570&#xff0c;\u5224\u65ad\u6761\u4ef6\u5fc5\u987b\u662f nums[fast] !&#061; 0\u3002<\/li>\n<li>\u524d\u79fb\u975e\u96f6\u5143\u7d20\u540e\u4e0d\u80fd\u5fd8\u8bb0\u8865\u96f6&#xff0c;\u5426\u5219\u6570\u7ec4\u540e\u534a\u90e8\u5206\u53ef\u80fd\u6b8b\u7559\u65e7\u503c\u3002<\/li>\n<li>\u9898\u76ee\u8981\u6c42\u539f\u5730\u4fee\u6539&#xff0c;\u65b9\u6cd5\u8fd4\u56de\u7c7b\u578b\u662f void&#xff0c;\u4e0d\u662f\u8fd4\u56de\u65b0\u6570\u7ec4\u3002<\/li>\n<li>\u4e0d\u80fd\u56e0\u4e3a\u62c5\u5fc3\u81ea\u5df1\u8986\u76d6\u81ea\u5df1&#xff0c;\u5c31\u5199\u51fa\u590d\u6742\u7684\u4ea4\u6362\u903b\u8f91&#xff1b;slow &#061;&#061; fast \u65f6\u8d4b\u503c\u662f\u5b89\u5168\u7684\u3002<\/li>\n<li>\u975e\u96f6\u5143\u7d20\u7684\u76f8\u5bf9\u987a\u5e8f\u5fc5\u987b\u4fdd\u6301&#xff0c;\u4e0d\u80fd\u4f7f\u7528\u4f1a\u6539\u53d8\u987a\u5e8f\u7684\u968f\u610f\u4ea4\u6362\u65b9\u6848\u3002<\/li>\n<p>\u8fd9\u9053\u9898\u8ba9\u6211\u5148\u8ba4\u8bc6\u5230\u4e00\u79cd\u5f88\u5e38\u89c1\u7684\u53cc\u6307\u9488\u804c\u8d23\u5206\u5de5&#xff1a;fast \u8d1f\u8d23\u627e&#xff0c;slow \u8d1f\u8d23\u653e\u3002\u540e\u9762\u7684\u540c\u5411\u6570\u7ec4\u9898\u4e5f\u53ef\u4ee5\u5148\u4ece\u8fd9\u4e2a\u89d2\u5ea6\u5224\u65ad\u3002<\/p>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u4e8c\u30011089. \u590d\u5199\u96f6<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u56fa\u5b9a\u957f\u5ea6\u7684\u6570\u7ec4 arr&#xff0c;\u6bcf\u9047\u5230\u4e00\u4e2a\u96f6&#xff0c;\u5c31\u5728\u5b83\u540e\u9762\u590d\u5236\u4e00\u4e2a\u96f6&#xff0c;\u5e76\u5c06\u53f3\u4fa7\u5143\u7d20\u4f9d\u6b21\u5411\u53f3\u79fb\u52a8\u3002\u8d85\u51fa\u6570\u7ec4\u957f\u5ea6\u7684\u5143\u7d20\u4f1a\u88ab\u4e22\u5f03\u3002\u8981\u6c42\u539f\u5730\u4fee\u6539\u6570\u7ec4&#xff0c;\u6570\u7ec4\u957f\u5ea6\u4fdd\u6301\u4e0d\u53d8\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;[1, 0, 2, 3, 0, 4, 5, 0] \u5904\u7406\u540e\u4e3a [1, 0, 0, 2, 3, 0, 0, 4]\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 1089. \u590d\u5199\u96f6<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u8fd9\u9053\u9898\u548c\u79fb\u52a8\u96f6\u7684\u533a\u522b\u5728\u4e8e&#xff1a;\u5143\u7d20\u4e0d\u662f\u88ab\u7b5b\u9009\u540e\u5360\u4e00\u4e2a\u4f4d\u7f6e&#xff0c;\u800c\u662f\u96f6\u4f1a\u989d\u5916\u5360\u7528\u4e00\u4e2a\u4f4d\u7f6e\u3002\u6570\u7ec4\u4ecd\u7136\u662f\u56fa\u5b9a\u957f\u5ea6&#xff0c;\u56e0\u6b64\u4ece\u524d\u5411\u540e\u76f4\u63a5\u5199\u4f1a\u8986\u76d6\u540e\u9762\u8fd8\u6ca1\u6709\u8bfb\u53d6\u7684\u5143\u7d20\u3002<\/p>\n<p>\u6211\u628a\u5b83\u7406\u89e3\u6210\u4e00\u4e2a\u201c\u865a\u62df\u6269\u5bb9\u6570\u7ec4\u201d&#xff1a;\u666e\u901a\u6570\u5b57\u5728\u865a\u62df\u6570\u7ec4\u4e2d\u5360\u4e00\u4e2a\u4f4d\u7f6e&#xff0c;\u96f6\u5360\u4e24\u4e2a\u4f4d\u7f6e\u3002\u5b9e\u9645\u6570\u7ec4\u5e76\u6ca1\u6709\u771f\u7684\u6269\u5bb9&#xff0c;\u53ea\u662f\u5148\u6309\u7167\u8fd9\u4e2a\u89c4\u5219\u8ba1\u7b97\u6bcf\u4e2a\u539f\u5143\u7d20\u5728\u865a\u62df\u6570\u7ec4\u4e2d\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>\u5177\u4f53\u505a\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<li>\u7edf\u8ba1\u539f\u6570\u7ec4\u4e2d\u96f6\u7684\u6570\u91cf zeros\u3002<\/li>\n<li>i \u4ece\u6570\u7ec4\u6700\u540e\u4e00\u4e2a\u4f4d\u7f6e\u5f00\u59cb&#xff0c;\u8868\u793a\u5f53\u524d\u6b63\u5728\u8bfb\u53d6\u7684\u539f\u5143\u7d20\u3002<\/li>\n<li>j \u4ece\u865a\u62df\u6269\u5bb9\u6570\u7ec4\u7684\u672b\u5c3e\u5f00\u59cb&#xff0c;\u8868\u793a\u5f53\u524d\u5e94\u8be5\u5199\u5165\u7684\u865a\u62df\u4f4d\u7f6e\u3002<\/li>\n<li>\u4ece\u540e\u5411\u524d\u5904\u7406\u6bcf\u4e2a\u539f\u5143\u7d20\u3002\u5982\u679c j \u843d\u5728\u771f\u5b9e\u6570\u7ec4\u8303\u56f4\u5185&#xff0c;\u5c31\u5199\u5165 nums[j] &#061; nums[i]\u3002<\/li>\n<li>\u5982\u679c\u5f53\u524d\u5143\u7d20\u662f\u96f6&#xff0c;\u8fd8\u9700\u8981\u8ba9 j \u518d\u5411\u5de6\u79fb\u52a8\u4e00\u683c&#xff0c;\u5e76\u5728\u8303\u56f4\u5185\u5199\u5165\u7b2c\u4e8c\u4e2a\u96f6\u3002<\/li>\n<li>\u6700\u540e\u8ba9 i \u548c j \u7ee7\u7eed\u5411\u5de6\u79fb\u52a8&#xff0c;\u5904\u7406\u524d\u4e00\u4e2a\u539f\u5143\u7d20\u3002<\/li>\n<p>\u4ece\u540e\u5411\u524d\u5199\u7684\u597d\u5904\u662f&#xff0c;\u5199\u5165\u4f4d\u7f6e\u4f4d\u4e8e\u5f53\u524d\u8bfb\u53d6\u4f4d\u7f6e\u7684\u53f3\u4fa7&#xff0c;\u6216\u8005\u4e0e\u5f53\u524d\u8bfb\u53d6\u4f4d\u7f6e\u91cd\u5408&#xff0c;\u4e0d\u4f1a\u7834\u574f\u5de6\u4fa7\u5c1a\u672a\u8bfb\u53d6\u7684\u5185\u5bb9\u3002\u82e5\u865a\u62df\u4f4d\u7f6e\u5df2\u7ecf\u8d85\u51fa\u771f\u5b9e\u6570\u7ec4\u8fb9\u754c&#xff0c;\u53ea\u8ba1\u7b97\u4f4d\u7f6e\u800c\u4e0d\u5b9e\u9645\u8d4b\u503c\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>class Solution {<br \/>\n    public void duplicateZeros(int[] nums) {<br \/>\n        int zeros &#061; 0;<br \/>\n        for (int num : nums) {<br \/>\n            if (num &#061;&#061; 0) {<br \/>\n                zeros&#043;&#043;;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        int i &#061; nums.length &#8211; 1;<br \/>\n        int j &#061; nums.length &#043; zeros &#8211; 1;<\/p>\n<p>        while (i &gt;&#061; 0) {<br \/>\n            if (j &lt; nums.length) {<br \/>\n                nums[j] &#061; nums[i];<br \/>\n            }<\/p>\n<p>            if (nums[i] &#061;&#061; 0) {<br \/>\n                j&#8211;;<br \/>\n                if (j &lt; nums.length) {<br \/>\n                    nums[j] &#061; 0;<br \/>\n                }<br \/>\n            }<\/p>\n<p>            i&#8211;;<br \/>\n            j&#8211;;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>zeros \u8868\u793a\u6240\u6709\u96f6\u5728\u865a\u62df\u6570\u7ec4\u4e2d\u591a\u5360\u51fa\u6765\u7684\u683c\u6570&#xff0c;\u56e0\u6b64\u865a\u62df\u6570\u7ec4\u6700\u540e\u4e00\u4e2a\u4e0b\u6807\u662f nums.length &#043; zeros &#8211; 1\u3002<\/p>\n<p>i \u59cb\u7ec8\u6307\u5411\u771f\u5b9e\u6570\u7ec4\u4e2d\u8fd8\u6ca1\u6709\u5904\u7406\u7684\u539f\u5143\u7d20&#xff0c;j \u6307\u5411\u8fd9\u4e2a\u539f\u5143\u7d20\u5728\u865a\u62df\u5e03\u5c40\u4e2d\u5e94\u8be5\u5199\u5165\u7684\u4f4d\u7f6e\u3002\u666e\u901a\u5143\u7d20\u53ea\u5360\u4e00\u683c&#xff0c;\u6240\u4ee5\u5199\u5b8c\u540e j&#8211;&#xff1b;\u96f6\u5360\u4e24\u683c&#xff0c;\u6240\u4ee5\u5148\u5199\u4e00\u4efd&#xff0c;\u518d\u989d\u5916 j&#8211; \u5199\u7b2c\u4e8c\u4efd\u96f6&#xff0c;\u6700\u540e\u518d\u7edf\u4e00 j&#8211; \u8fdb\u5165\u524d\u4e00\u4e2a\u539f\u5143\u7d20\u5bf9\u5e94\u7684\u533a\u57df\u3002<\/p>\n<p>\u8fb9\u754c\u5224\u65ad\u53ea\u5728\u5199\u5165\u524d\u8fdb\u884c\u3002\u6bd4\u5982\u865a\u62df\u6570\u7ec4\u7684\u672b\u5c3e\u53ef\u80fd\u8d85\u8fc7\u771f\u5b9e\u6570\u7ec4\u672b\u5c3e&#xff0c;\u8fd9\u4e9b\u4f4d\u7f6e\u867d\u7136\u53c2\u4e0e\u4e86\u8ba1\u7b97&#xff0c;\u4f46\u4e0d\u80fd\u8bbf\u95ee nums[j]\u3002\u56e0\u6b64 if (j &lt; nums.length) \u662f\u907f\u514d\u6570\u7ec4\u8d8a\u754c\u7684\u5173\u952e\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;O(n)\u3002\u7edf\u8ba1\u96f6\u4e00\u6b21&#xff0c;\u5012\u5e8f\u5904\u7406\u4e00\u6b21\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O(1)\u3002\u6ca1\u6709\u521b\u5efa\u865a\u62df\u6570\u7ec4&#xff0c;\u865a\u62df\u6570\u7ec4\u53ea\u662f\u7528\u6765\u63a8\u5bfc\u4e0b\u6807\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>\u4e0d\u80fd\u4ece\u524d\u5411\u540e\u76f4\u63a5\u590d\u5236&#xff0c;\u5426\u5219\u65b0\u5199\u5165\u7684\u5185\u5bb9\u53ef\u80fd\u8986\u76d6\u540e\u9762\u8fd8\u6ca1\u6709\u8bfb\u5230\u7684\u5143\u7d20\u3002<\/li>\n<li>j \u53ef\u80fd\u5927\u4e8e\u7b49\u4e8e nums.length&#xff0c;\u5199\u5165\u524d\u5fc5\u987b\u68c0\u67e5\u8303\u56f4\u3002<\/li>\n<li>\u5f53\u524d\u5143\u7d20\u4e3a\u96f6\u65f6&#xff0c;\u9700\u8981\u989d\u5916\u5411\u5de6\u79fb\u52a8\u4e00\u6b21\u5e76\u5199\u5165\u7b2c\u4e8c\u4e2a\u96f6\u3002<\/li>\n<li>\u201c\u865a\u62df\u6269\u5bb9\u201d\u4e0d\u7b49\u4e8e\u771f\u7684\u521b\u5efa\u4e00\u4e2a\u66f4\u957f\u7684\u6570\u7ec4&#xff0c;\u5426\u5219\u7a7a\u95f4\u590d\u6742\u5ea6\u5c31\u4e0d\u662f\u5e38\u6570\u4e86\u3002<\/li>\n<li>\u6709\u4e9b\u8fb9\u754c\u4f4d\u7f6e\u7684\u96f6\u590d\u5236\u540e\u5b8c\u5168\u843d\u5728\u6570\u7ec4\u5916&#xff0c;\u53ea\u9700\u8981\u8ba1\u7b97&#xff0c;\u4e0d\u9700\u8981\u5199\u5165\u3002<\/li>\n<p>\u548c\u79fb\u52a8\u96f6\u653e\u5728\u4e00\u8d77\u770b&#xff0c;\u4e8c\u8005\u90fd\u5c5e\u4e8e\u539f\u5730\u8bfb\u5199&#xff0c;\u4f46\u65b9\u5411\u76f8\u53cd&#xff1a;\u5982\u679c\u5199\u5165\u4e0d\u4f1a\u589e\u52a0\u5143\u7d20\u6570\u91cf&#xff0c;\u53ef\u4ee5\u4ece\u524d\u5411\u540e\u7528\u5feb\u6162\u6307\u9488&#xff1b;\u5982\u679c\u4e00\u4e2a\u5143\u7d20\u53ef\u80fd\u6269\u5c55\u6210\u591a\u4e2a\u4f4d\u7f6e&#xff0c;\u5e76\u4e14\u524d\u5199\u4f1a\u8986\u76d6\u672a\u8bfb\u6570\u636e&#xff0c;\u5c31\u66f4\u9002\u5408\u4ece\u540e\u5411\u524d\u5904\u7406\u3002<\/p>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u4e09\u3001202. \u5feb\u4e50\u6570<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u6b63\u6574\u6570 n&#xff0c;\u4e0d\u65ad\u5c06\u5b83\u66ff\u6362\u4e3a\u5404\u4f4d\u6570\u5b57\u7684\u5e73\u65b9\u548c\u3002\u5982\u679c\u6700\u7ec8\u5f97\u5230 1&#xff0c;\u90a3\u4e48\u8fd9\u4e2a\u6570\u5c31\u662f\u5feb\u4e50\u6570&#xff1b;\u5982\u679c\u8ba1\u7b97\u8fc7\u7a0b\u8fdb\u5165\u4e00\u4e2a\u4e0d\u5305\u542b 1 \u7684\u5faa\u73af&#xff0c;\u5219\u5b83\u4e0d\u662f\u5feb\u4e50\u6570\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;19 \u2192 82 \u2192 68 \u2192 100 \u2192 1&#xff0c;\u6240\u4ee5 19 \u662f\u5feb\u4e50\u6570\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 202. \u5feb\u4e50\u6570<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u8fd9\u9053\u9898\u8868\u9762\u4e0a\u6ca1\u6709\u6570\u7ec4\u4e0b\u6807&#xff0c;\u4f46\u4ecd\u7136\u53ef\u4ee5\u4f7f\u7528\u5feb\u6162\u6307\u9488\u3002\u6bcf\u4e2a\u6570\u5b57\u90fd\u53ef\u4ee5\u770b\u6210\u4e00\u4e2a\u72b6\u6001&#xff0c;\u8ba1\u7b97\u201c\u5404\u4f4d\u6570\u5b57\u5e73\u65b9\u548c\u201d\u5c31\u662f\u4ece\u5f53\u524d\u72b6\u6001\u8d70\u5411\u4e0b\u4e00\u4e2a\u72b6\u6001\u3002<\/p>\n<p>\u5982\u679c\u4e00\u4e2a\u72b6\u6001\u5e8f\u5217\u6700\u7ec8\u5230\u8fbe 1&#xff0c;\u7531\u4e8e 1 \u7684\u4e0b\u4e00\u4e2a\u72b6\u6001\u4ecd\u7136\u662f 1&#xff0c;\u6240\u4ee5\u5b83\u4f1a\u8fdb\u5165 1 \u8fd9\u4e2a\u957f\u5ea6\u4e3a\u4e00\u7684\u73af\u3002\u5982\u679c\u4e0d\u662f\u5feb\u4e50\u6570&#xff0c;\u5e8f\u5217\u4e5f\u4f1a\u8fdb\u5165\u53e6\u4e00\u4e2a\u73af\u3002\u95ee\u9898\u7684\u5173\u952e\u5c31\u53d8\u6210\u4e86&#xff1a;\u72b6\u6001\u5e8f\u5217\u662f\u5426\u6210\u73af&#xff0c;\u4ee5\u53ca\u76f8\u9047\u65f6\u7684\u72b6\u6001\u662f\u4e0d\u662f 1\u3002<\/p>\n<p>\u505a\u6cd5\u662f&#xff1a;<\/p>\n<ul>\n<li>slow \u6bcf\u6b21\u6267\u884c\u4e00\u6b21 getNext&#xff1b;<\/li>\n<li>fast \u6bcf\u6b21\u6267\u884c\u4e24\u6b21 getNext&#xff1b;<\/li>\n<li>\u5982\u679c\u5e8f\u5217\u8fdb\u5165\u73af&#xff0c;\u5feb\u6307\u9488\u6700\u7ec8\u4f1a\u8ffd\u4e0a\u6162\u6307\u9488&#xff1b;<\/li>\n<li>\u76f8\u9047\u540e\u5224\u65ad\u76f8\u9047\u503c\u662f\u5426\u4e3a 1\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u5c06\u6570\u5b57\u72b6\u6001\u5f53\u6210\u94fe\u8868\u8282\u70b9&#xff0c;getNext \u5c31\u7c7b\u4f3c\u4e8e\u94fe\u8868\u8282\u70b9\u7684 next\u3002\u5feb\u6162\u6307\u9488\u4e0d\u4e00\u5b9a\u53ea\u80fd\u64cd\u4f5c\u6570\u7ec4\u6216\u94fe\u8868&#xff0c;\u53ea\u8981\u5bf9\u8c61\u4e4b\u95f4\u5b58\u5728\u201c\u4e0b\u4e00\u6b65\u201d\u7684\u5173\u7cfb&#xff0c;\u5c31\u53ef\u80fd\u7528\u6765\u5224\u65ad\u73af\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>class Solution {<br \/>\n    public boolean isHappy(int n) {<br \/>\n        int slow &#061; n;<br \/>\n        int fast &#061; getNext(n);<\/p>\n<p>        while (slow !&#061; fast) {<br \/>\n            slow &#061; getNext(slow);<br \/>\n            fast &#061; getNext(getNext(fast));<br \/>\n        }<\/p>\n<p>        return slow &#061;&#061; 1;<br \/>\n    }<\/p>\n<p>    private int getNext(int n) {<br \/>\n        int sum &#061; 0;<\/p>\n<p>        while (n &gt; 0) {<br \/>\n            int digit &#061; n % 10;<br \/>\n            sum &#043;&#061; digit * digit;<br \/>\n            n \/&#061; 10;<br \/>\n        }<\/p>\n<p>        return sum;<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>getNext(int n) \u8d1f\u8d23\u8ba1\u7b97\u4e0b\u4e00\u4e2a\u72b6\u6001\u3002n % 10 \u53d6\u51fa\u5f53\u524d\u4e2a\u4f4d\u6570\u5b57&#xff0c;n \/&#061; 10 \u53bb\u6389\u4e2a\u4f4d&#xff0c;\u5faa\u73af\u7ed3\u675f\u65f6\u5c31\u5f97\u5230\u4e86\u6240\u6709\u4f4d\u6570\u5b57\u5e73\u65b9\u548c\u3002<\/p>\n<p>\u8fd9\u91cc\u5c06 slow \u521d\u59cb\u5316\u4e3a n&#xff0c;\u5c06 fast \u521d\u59cb\u5316\u4e3a getNext(n)&#xff0c;\u76f8\u5f53\u4e8e\u8ba9\u5feb\u6307\u9488\u5148\u8d70\u4e00\u6b65\u3002\u8fd9\u6837\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u666e\u901a\u7684 while (slow !&#061; fast)\u3002\u5982\u679c\u4e24\u4e2a\u6307\u9488\u90fd\u521d\u59cb\u5316\u4e3a n&#xff0c;\u5219\u9700\u8981\u91c7\u7528 do&#8230;while \u6216\u5176\u4ed6\u65b9\u5f0f\u4fdd\u8bc1\u81f3\u5c11\u5148\u6267\u884c\u4e00\u6b21\u79fb\u52a8\u3002<\/p>\n<p>\u975e\u5feb\u4e50\u6570 2 \u7684\u53d8\u5316\u8fc7\u7a0b\u4f1a\u51fa\u73b0&#xff1a;2 \u2192 4 \u2192 16 \u2192 37 \u2192 58 \u2192 89 \u2192 145 \u2192 42 \u2192 20 \u2192 4\u3002\u518d\u6b21\u9047\u5230 4 \u5c31\u8bf4\u660e\u8fdb\u5165\u4e86\u5faa\u73af&#xff0c;\u5feb\u6162\u6307\u9488\u4f1a\u5728\u8fd9\u4e2a\u73af\u4e2d\u76f8\u9047&#xff0c;\u800c\u76f8\u9047\u503c\u4e0d\u662f 1\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;\u6bcf\u6b21\u8ba1\u7b97\u5404\u4f4d\u5e73\u65b9\u548c\u9700\u8981\u5904\u7406\u6570\u5b57\u7684\u4f4d\u6570&#xff0c;\u5355\u6b21\u662f O(log n)&#xff1b;\u5bf9\u4e8e int \u8303\u56f4\u7684\u8f93\u5165&#xff0c;\u72b6\u6001\u5f88\u5feb\u4f1a\u8fdb\u5165\u4e00\u4e2a\u6709\u9650\u7684\u5c0f\u8303\u56f4&#xff0c;\u6574\u4f53\u53ef\u4ee5\u6309 O(log n) \u7ea7\u522b\u7406\u89e3\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O(1)\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>fast \u6bcf\u8f6e\u5fc5\u987b\u8d70\u4e24\u6b65&#xff0c;\u5373 getNext(getNext(fast))\u3002<\/li>\n<li>\u4e0d\u80fd\u53ea\u5faa\u73af\u5230 n &#061;&#061; 1&#xff0c;\u56e0\u4e3a\u975e\u5feb\u4e50\u6570\u4f1a\u65e0\u9650\u5faa\u73af&#xff0c;\u9700\u8981\u663e\u5f0f\u5904\u7406\u73af\u3002<\/li>\n<li>\u53d6\u4e2a\u4f4d\u4f7f\u7528 % 10&#xff0c;\u53bb\u6389\u4e2a\u4f4d\u4f7f\u7528 \/&#061; 10\u3002<\/li>\n<li>1 \u672c\u8eab\u662f\u4e00\u4e2a\u81ea\u73af&#xff0c;\u6240\u4ee5\u6700\u540e\u5224\u65ad\u76f8\u9047\u503c\u662f\u5426\u4e3a 1\u3002<\/li>\n<li>\u53e6\u4e00\u79cd\u5e38\u89c1\u5199\u6cd5\u662f\u7528 HashSet \u8bb0\u5f55\u51fa\u73b0\u8fc7\u7684\u72b6\u6001&#xff0c;\u903b\u8f91\u76f4\u89c2\u4f46\u9700\u8981 O(n) \u7ea7\u522b\u7684\u989d\u5916\u7a7a\u95f4&#xff1b;\u672c\u9898\u7684\u5feb\u6162\u6307\u9488\u7248\u672c\u628a\u8f85\u52a9\u7a7a\u95f4\u964d\u5230\u4e86 O(1)\u3002<\/li>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u56db\u300111. \u76db\u6700\u591a\u6c34\u7684\u5bb9\u5668<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u6574\u6570\u6570\u7ec4 height&#xff0c;\u5176\u4e2d height[i] \u8868\u793a\u4f4d\u4e8e\u4e0b\u6807 i \u7684\u7ad6\u7ebf\u9ad8\u5ea6\u3002\u9009\u62e9\u4e24\u6761\u4e0d\u540c\u7684\u7ad6\u7ebf&#xff0c;\u4e0e\u6a2a\u8f74\u5171\u540c\u6784\u6210\u4e00\u4e2a\u5bb9\u5668&#xff0c;\u6c42\u8fd9\u4e2a\u5bb9\u5668\u80fd\u591f\u76db\u653e\u7684\u6700\u5927\u6c34\u91cf\u3002<\/p>\n<p>\u5bb9\u5668\u9762\u79ef\u7531\u4e24\u90e8\u5206\u51b3\u5b9a&#xff1a;\u4e24\u6761\u7ebf\u4e4b\u95f4\u7684\u5bbd\u5ea6&#xff0c;\u4ee5\u53ca\u4e24\u6761\u7ebf\u4e2d\u8f83\u77ed\u7684\u9ad8\u5ea6\u3002\u9762\u79ef\u516c\u5f0f\u662f min(height[left], height[right]) * (right &#8211; left)\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 11. \u76db\u6700\u591a\u6c34\u7684\u5bb9\u5668<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u8fd9\u662f\u76f8\u5411\u53cc\u6307\u9488\u7684\u5178\u578b\u9898\u3002\u5f00\u59cb\u65f6\u8ba9 left \u4f4d\u4e8e\u6700\u5de6\u7aef\u3001right \u4f4d\u4e8e\u6700\u53f3\u7aef&#xff0c;\u6b64\u65f6\u5bbd\u5ea6\u6700\u5927\u3002\u6bcf\u4e00\u8f6e\u5148\u8ba1\u7b97\u5f53\u524d\u5bb9\u5668\u9762\u79ef&#xff0c;\u518d\u51b3\u5b9a\u79fb\u52a8\u54ea\u4e00\u4fa7\u3002<\/p>\n<p>\u6c34\u4f4d\u53d7\u5230\u77ed\u677f\u9650\u5236&#xff0c;\u6240\u4ee5\u5982\u679c\u5de6\u8fb9\u9ad8\u5ea6\u8f83\u5c0f&#xff0c;\u7ee7\u7eed\u4fdd\u7559\u5de6\u8fb9\u800c\u53ea\u8ba9\u53f3\u8fb9\u5411\u5185\u79fb\u52a8\u65f6&#xff1a;<\/p>\n<ul>\n<li>\u5bbd\u5ea6\u4e00\u5b9a\u4f1a\u53d8\u5c0f&#xff1b;<\/li>\n<li>\u6c34\u4f4d\u4ecd\u7136\u4e0d\u4f1a\u8d85\u8fc7\u5f53\u524d\u5de6\u8fb9\u7684\u77ed\u677f&#xff1b;<\/li>\n<li>\u9762\u79ef\u4e0d\u53ef\u80fd\u8d85\u8fc7\u5f53\u524d\u8fd9\u7ec4\u8fb9\u754c\u7684\u9762\u79ef\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;\u5de6\u8fb9\u8f83\u77ed\u65f6&#xff0c;\u5f53\u524d\u5de6\u8fb9\u754c\u5bf9\u5e94\u7684\u5176\u4ed6\u66f4\u7a84\u7ec4\u5408\u90fd\u53ef\u4ee5\u6392\u9664&#xff0c;\u53ea\u6709\u6362\u6389\u5de6\u8fb9\u3001\u5bfb\u627e\u66f4\u9ad8\u7684\u5de6\u8fb9\u754c\u624d\u6709\u53ef\u80fd\u4ea7\u751f\u66f4\u5927\u7684\u9762\u79ef\u3002\u53f3\u8fb9\u8f83\u77ed\u65f6\u540c\u7406\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u201c\u79fb\u52a8\u77ed\u8fb9\u201d\u7684\u4f9d\u636e&#xff0c;\u4e0d\u662f\u4e00\u4e2a\u8131\u79bb\u9898\u76ee\u6761\u4ef6\u7684\u56fa\u5b9a\u53e3\u8bc0\u3002\u5b83\u4f9d\u8d56\u4e8e\u9762\u79ef\u4e2d\u7684\u77ed\u677f\u9650\u5236\u548c\u5bbd\u5ea6\u5355\u8c03\u53d8\u5c0f\u8fd9\u4e24\u4e2a\u4e8b\u5b9e\u3002\u5f53\u4e24\u8fb9\u4e00\u6837\u9ad8\u65f6&#xff0c;\u79fb\u52a8\u4efb\u610f\u4e00\u8fb9\u90fd\u53ef\u4ee5&#xff0c;\u4ee3\u7801\u4e2d\u9009\u62e9\u79fb\u52a8\u5de6\u8fb9\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>class Solution {<br \/>\n    public int maxArea(int[] height) {<br \/>\n        int left &#061; 0;<br \/>\n        int right &#061; height.length &#8211; 1;<br \/>\n        int ret &#061; 0;<\/p>\n<p>        while (left &lt; right) {<br \/>\n            int width &#061; right &#8211; left;<br \/>\n            int minHeight &#061; Math.min(height[left], height[right]);<br \/>\n            int area &#061; width * minHeight;<br \/>\n            ret &#061; Math.max(ret, area);<\/p>\n<p>            if (height[left] &lt;&#061; height[right]) {<br \/>\n                left&#043;&#043;;<br \/>\n            } else {<br \/>\n                right&#8211;;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        return ret;<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>left \u548c right \u8868\u793a\u5f53\u524d\u8fd8\u6ca1\u6709\u6392\u9664\u7684\u4e24\u6761\u8fb9\u3002\u5bbd\u5ea6\u662f\u4e0b\u6807\u5dee right &#8211; left&#xff0c;\u4e0d\u662f\u5143\u7d20\u4e2a\u6570&#xff0c;\u6240\u4ee5\u4e0d\u9700\u8981\u52a0\u4e00\u3002<\/p>\n<p>\u6bcf\u8f6e\u5148\u901a\u8fc7 Math.min \u6c42\u51fa\u77ed\u677f\u9ad8\u5ea6&#xff0c;\u518d\u8ba1\u7b97\u9762\u79ef\u5e76\u66f4\u65b0 ret\u3002\u66f4\u65b0\u5b8c\u5f53\u524d\u7ec4\u5408\u540e&#xff0c;\u6839\u636e\u4e24\u8fb9\u9ad8\u5ea6\u51b3\u5b9a\u79fb\u52a8\u77ed\u8fb9\u3002\u5faa\u73af\u6761\u4ef6\u662f left &lt; right&#xff0c;\u56e0\u4e3a\u540c\u4e00\u4e2a\u4e0b\u6807\u4e0d\u80fd\u5f62\u6210\u6709\u5bbd\u5ea6\u7684\u5bb9\u5668\u3002<\/p>\n<p>\u4f8b\u5982\u6570\u7ec4 [1,8,6,2,5,4,8,3,7]&#xff0c;\u6700\u521d\u4e24\u7aef\u5f62\u6210\u9762\u79ef 8\u3002\u5de6\u8fb9\u9ad8\u5ea6 1 \u662f\u77ed\u677f&#xff0c;\u79fb\u52a8\u5de6\u6307\u9488\u540e&#xff0c;\u8fb9\u754c\u6765\u5230\u9ad8\u5ea6 8&#xff0c;\u6b64\u65f6\u4e0e\u53f3\u7aef\u9ad8\u5ea6 7 \u5f62\u6210\u9762\u79ef 7 * 7 &#061; 49&#xff0c;\u540e\u7eed\u641c\u7d22\u4e0d\u4f1a\u5f97\u5230\u66f4\u5927\u7ed3\u679c\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;O(n)\u3002\u6bcf\u8f6e\u81f3\u5c11\u79fb\u52a8\u4e00\u4e2a\u6307\u9488&#xff0c;\u4e24\u4e2a\u6307\u9488\u603b\u5171\u53ea\u5411\u5185\u79fb\u52a8\u6709\u9650\u6b21\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O(1)\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>\u6c34\u4f4d\u662f\u8f83\u77ed\u8fb9\u7684\u9ad8\u5ea6&#xff0c;\u5fc5\u987b\u4f7f\u7528 Math.min&#xff0c;\u4e0d\u80fd\u4f7f\u7528 Math.max\u3002<\/li>\n<li>\u5bbd\u5ea6\u662f right &#8211; left\u3002<\/li>\n<li>\u5148\u8ba1\u7b97\u5e76\u66f4\u65b0\u5f53\u524d\u9762\u79ef&#xff0c;\u518d\u79fb\u52a8\u6307\u9488&#xff0c;\u907f\u514d\u6f0f\u7b97\u5f53\u524d\u8fb9\u754c\u7ec4\u5408\u3002<\/li>\n<li>\u79fb\u52a8\u77ed\u8fb9\u800c\u4e0d\u662f\u957f\u8fb9&#xff1b;\u957f\u8fb9\u88ab\u4fdd\u7559\u65f6&#xff0c;\u5bbd\u5ea6\u53d8\u5c0f\u4f46\u77ed\u677f\u4e0a\u9650\u6ca1\u6709\u6539\u5584\u3002<\/li>\n<li>\u5faa\u73af\u6761\u4ef6\u5e94\u4e3a left &lt; right\u3002<\/li>\n<li>int \u53ef\u4ee5\u8986\u76d6\u9898\u76ee\u901a\u5e38\u7ed9\u51fa\u7684\u9762\u79ef\u8303\u56f4&#xff0c;\u4f46\u5982\u679c\u9898\u76ee\u7ea6\u675f\u66f4\u5927&#xff0c;\u9762\u79ef\u8ba1\u7b97\u4e5f\u9700\u8981\u68c0\u67e5\u662f\u5426\u5e94\u8be5\u4f7f\u7528 long\u3002<\/li>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u4e94\u3001611. \u6709\u6548\u4e09\u89d2\u5f62\u7684\u4e2a\u6570<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u5305\u542b\u975e\u8d1f\u6574\u6570\u7684\u6570\u7ec4 nums&#xff0c;\u7edf\u8ba1\u4ece\u6570\u7ec4\u4e2d\u9009\u62e9\u4e09\u4e2a\u4e0b\u6807\u540e&#xff0c;\u80fd\u591f\u7ec4\u6210\u4e09\u89d2\u5f62\u7684\u7ec4\u5408\u6570\u91cf\u3002\u76f8\u540c\u6570\u503c\u5982\u679c\u6765\u81ea\u4e0d\u540c\u4e0b\u6807&#xff0c;\u4ecd\u7136\u5c5e\u4e8e\u4e0d\u540c\u7684\u4e0b\u6807\u7ec4\u5408&#xff0c;\u9700\u8981\u5206\u522b\u8ba1\u6570\u3002<\/p>\n<p>\u4e09\u89d2\u5f62\u6210\u7acb\u7684\u6761\u4ef6\u662f&#xff1a;\u4e24\u6761\u8f83\u77ed\u8fb9\u4e4b\u548c\u4e25\u683c\u5927\u4e8e\u6700\u957f\u8fb9\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 611. \u6709\u6548\u4e09\u89d2\u5f62\u7684\u4e2a\u6570<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u76f4\u63a5\u4f7f\u7528\u4e09\u5c42\u5faa\u73af\u4f1a\u5f97\u5230 O(n\u00b3)\u3002\u6392\u5e8f\u4ee5\u540e&#xff0c;\u53ef\u4ee5\u56fa\u5b9a\u6700\u957f\u8fb9&#xff0c;\u518d\u7528\u5de6\u53f3\u6307\u9488\u6279\u91cf\u7edf\u8ba1\u6ee1\u8db3\u6761\u4ef6\u7684\u7ec4\u5408\u3002<\/p>\n<p>\u5148\u5bf9\u6570\u7ec4\u5347\u5e8f\u6392\u5e8f\u3002\u4ee4 i \u4ece\u6570\u7ec4\u672b\u5c3e\u5411\u524d\u79fb\u52a8&#xff0c;\u628a nums[i] \u4f5c\u4e3a\u5f53\u524d\u56fa\u5b9a\u7684\u6700\u957f\u8fb9\u3002\u5269\u4e0b\u7684\u4e24\u6761\u8fb9\u5728 [0, i &#8211; 1] \u4e2d\u9009\u62e9&#xff0c;\u8bbe\u7f6e&#xff1a;<\/p>\n<ul>\n<li>left &#061; 0&#xff0c;\u6307\u5411\u5f53\u524d\u6700\u5c0f\u5019\u9009\u8fb9&#xff1b;<\/li>\n<li>right &#061; i &#8211; 1&#xff0c;\u6307\u5411\u5f53\u524d\u6700\u5927\u7684\u5019\u9009\u8fb9\u3002<\/li>\n<\/ul>\n<p>\u5224\u65ad nums[left] &#043; nums[right] &gt; nums[i]&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c\u6210\u7acb&#xff0c;\u7531\u4e8e\u6570\u7ec4\u5df2\u7ecf\u6709\u5e8f&#xff0c;left \u5230 right &#8211; 1 \u7684\u6240\u6709\u5143\u7d20\u90fd\u4e0d\u5c0f\u4e8e nums[left]&#xff0c;\u5b83\u4eec\u548c nums[right] \u7ec4\u6210\u7684\u7ec4\u5408\u4e5f\u90fd\u6ee1\u8db3\u6761\u4ef6\u3002\u56e0\u6b64\u53ef\u4ee5\u4e00\u6b21\u589e\u52a0 right &#8211; left \u4e2a\u7b54\u6848&#xff0c;\u7136\u540e\u8ba9 right&#8211;\u3002<\/li>\n<li>\u5982\u679c\u4e0d\u6210\u7acb&#xff0c;\u8bf4\u660e\u5f53\u524d\u6700\u5c0f\u8fb9\u592a\u5c0f\u3002\u56fa\u5b9a left \u65f6&#xff0c;\u5373\u4f7f\u4f7f\u7528\u6700\u5927\u7684\u53e6\u4e00\u6761\u8fb9 nums[right] \u4e5f\u4e0d\u591f&#xff0c;\u53ea\u6709\u8ba9 left&#043;&#043; \u53d8\u5927\u624d\u6709\u673a\u4f1a\u6ee1\u8db3\u6761\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u7684\u6279\u91cf\u8ba1\u6570\u662f\u672c\u9898\u6700\u91cd\u8981\u7684\u5730\u65b9\u3002\u6392\u5e8f\u5e26\u6765\u7684\u5355\u8c03\u6027\u8ba9\u4e00\u6b21\u5224\u65ad\u53ef\u4ee5\u8986\u76d6\u4e00\u6574\u6bb5\u5019\u9009&#xff0c;\u800c\u4e0d\u662f\u9010\u4e2a\u68c0\u67e5\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>import java.util.Arrays;<\/p>\n<p>class Solution {<br \/>\n    public int triangleNumber(int[] nums) {<br \/>\n        Arrays.sort(nums);<br \/>\n        int ret &#061; 0;<\/p>\n<p>        for (int i &#061; nums.length &#8211; 1; i &gt;&#061; 2; i&#8211;) {<br \/>\n            int left &#061; 0;<br \/>\n            int right &#061; i &#8211; 1;<\/p>\n<p>            while (left &lt; right) {<br \/>\n                if (nums[left] &#043; nums[right] &gt; nums[i]) {<br \/>\n                    ret &#043;&#061; right &#8211; left;<br \/>\n                    right&#8211;;<br \/>\n                } else {<br \/>\n                    left&#043;&#043;;<br \/>\n                }<br \/>\n            }<br \/>\n        }<\/p>\n<p>        return ret;<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>\u6392\u5e8f\u540e\u56fa\u5b9a\u7684 nums[i] \u662f\u6700\u957f\u8fb9&#xff0c;\u6240\u4ee5\u53ea\u9700\u8981\u5224\u65ad nums[left] &#043; nums[right] &gt; nums[i]\u3002\u53e6\u5916\u4e24\u7ec4\u8fb9\u4e4b\u548c\u4e00\u5b9a\u4e0d\u4f1a\u66f4\u5c0f&#xff0c;\u56e0\u4e3a nums[i] \u5df2\u7ecf\u662f\u4e09\u8005\u4e2d\u7684\u6700\u5927\u503c\u3002<\/p>\n<p>\u6761\u4ef6\u6210\u7acb\u65f6&#xff0c;\u4e3a\u4ec0\u4e48\u589e\u52a0 right &#8211; left \u800c\u4e0d\u662f right &#8211; left &#043; 1&#xff1f;\u5f53\u524d right \u5df2\u7ecf\u88ab\u4f5c\u4e3a\u7b2c\u4e8c\u6761\u8fb9\u4f7f\u7528&#xff0c;\u5de6\u8fb9\u53ea\u80fd\u4ece left \u5230 right &#8211; 1 \u9009\u62e9&#xff0c;\u5171\u6709 right &#8211; left \u4e2a\u4e0b\u6807\u3002\u4e4b\u540e right&#8211;&#xff0c;\u7ee7\u7eed\u5904\u7406\u4e0b\u4e00\u6761\u53ef\u80fd\u7684\u7b2c\u4e8c\u957f\u8fb9\u3002<\/p>\n<p>\u6761\u4ef6\u4e0d\u6210\u7acb\u65f6&#xff0c;\u5f53\u524d left \u548c\u6700\u5927\u7684 right \u90fd\u65e0\u6cd5\u7ec4\u6210\u4e09\u89d2\u5f62&#xff0c;\u56e0\u6b64\u4fdd\u7559\u8fd9\u4e2a left \u6ca1\u6709\u5fc5\u8981&#xff0c;\u76f4\u63a5 left&#043;&#043;\u3002<\/p>\n<p>\u4f8b\u5982\u6392\u5e8f\u540e\u7684 [2, 2, 3, 4]&#xff1a;\u56fa\u5b9a\u6700\u957f\u8fb9 4 \u65f6&#xff0c;3 \u4e0e\u4e24\u4e2a 2 \u90fd\u80fd\u7ec4\u6210\u4e09\u89d2\u5f62&#xff0c;\u4e00\u6b21\u8ba1\u5165\u4e24\u4e2a\u7ec4\u5408&#xff1b;\u56fa\u5b9a\u6700\u957f\u8fb9 3 \u65f6&#xff0c;\u4e24\u4e2a 2 \u53c8\u7ec4\u6210\u4e00\u4e2a\u7ec4\u5408&#xff0c;\u603b\u6570\u4e3a 3\u3002\u8fd9\u91cc\u76f8\u540c\u7684\u8fb9\u957f\u6765\u81ea\u4e0d\u540c\u4e0b\u6807&#xff0c;\u56e0\u6b64\u4e0d\u80fd\u50cf\u4e09\u6570\u4e4b\u548c\u90a3\u6837\u6309\u6570\u503c\u53bb\u91cd\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;\u6392\u5e8f\u4e3a O(n log n)&#xff0c;\u5916\u5c42\u56fa\u5b9a\u6700\u957f\u8fb9\u5e76\u8fdb\u884c\u53cc\u6307\u9488\u626b\u63cf\u7684\u90e8\u5206\u4e3a O(n\u00b2)&#xff0c;\u603b\u590d\u6742\u5ea6\u662f O(n\u00b2)\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;\u9664\u6392\u5e8f\u5b9e\u73b0\u53ef\u80fd\u4f7f\u7528\u7684\u6808\u7a7a\u95f4\u5916&#xff0c;\u7b97\u6cd5\u53ea\u4f7f\u7528\u5e38\u6570\u4e2a\u53d8\u91cf&#xff1b;Java \u4e2d Arrays.sort(int[]) \u7684\u5177\u4f53\u8f85\u52a9\u7a7a\u95f4\u53d6\u51b3\u4e8e\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>\u4e09\u89d2\u5f62\u6761\u4ef6\u662f\u4e25\u683c\u5927\u4e8e &gt;&#xff0c;\u7b49\u4e8e\u65f6\u53ea\u662f\u9000\u5316\u6210\u4e00\u6761\u76f4\u7ebf\u3002<\/li>\n<li>\u6761\u4ef6\u6210\u7acb\u65f6\u589e\u52a0 right &#8211; left&#xff0c;\u4e0d\u8981\u628a right \u81ea\u5df1\u91cd\u590d\u7b97\u4f5c\u5de6\u8fb9\u3002<\/li>\n<li>\u6761\u4ef6\u6210\u7acb\u79fb\u52a8 right&#xff0c;\u6761\u4ef6\u4e0d\u6210\u7acb\u79fb\u52a8 left&#xff0c;\u65b9\u5411\u4e0d\u80fd\u5199\u53cd\u3002<\/li>\n<li>\u5fc5\u987b\u5148\u6392\u5e8f&#xff0c;\u5426\u5219\u65e0\u6cd5\u4f7f\u7528\u6279\u91cf\u7edf\u8ba1\u7684\u5355\u8c03\u6027\u3002<\/li>\n<li>\u96f6\u4f1a\u88ab\u4e25\u683c\u4e0d\u7b49\u5f0f\u81ea\u7136\u6392\u9664&#xff0c;\u4e0d\u5fc5\u5355\u72ec\u5220\u9664\u3002<\/li>\n<li>\u672c\u9898\u7edf\u8ba1\u7684\u662f\u4e0b\u6807\u7ec4\u5408&#xff0c;\u4e0d\u662f\u4e0d\u540c\u6570\u503c\u7ec4\u5408&#xff1b;\u91cd\u590d\u6570\u503c\u6765\u81ea\u4e0d\u540c\u4e0b\u6807\u65f6\u8981\u5206\u522b\u8ba1\u6570\u3002<\/li>\n<li>\u5982\u679c\u9898\u76ee\u6570\u636e\u8303\u56f4\u4f7f\u7b54\u6848\u53ef\u80fd\u8d85\u8fc7 int&#xff0c;\u8fd8\u9700\u8981\u6839\u636e\u9898\u76ee\u7ea6\u675f\u9009\u62e9\u66f4\u5927\u7684\u7ed3\u679c\u7c7b\u578b&#xff1b;\u5e38\u89c4\u9898\u76ee\u7ea6\u675f\u4e0b int \u8fd4\u56de\u503c\u7b26\u5408\u9898\u9762\u8981\u6c42\u3002<\/li>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u516d\u3001LCR 179. \u4e24\u6570\u4e4b\u548c<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u5df2\u7ecf\u6309\u975e\u9012\u51cf\u987a\u5e8f\u6392\u5217\u7684\u6570\u7ec4 price \u548c\u76ee\u6807\u503c target&#xff0c;\u627e\u51fa\u4e24\u4e2a\u6570&#xff0c;\u4f7f\u5b83\u4eec\u7684\u548c\u7b49\u4e8e target&#xff0c;\u5e76\u8fd4\u56de\u8fd9\u4e24\u4e2a\u6570\u3002\u9898\u76ee\u901a\u5e38\u4fdd\u8bc1\u5b58\u5728\u6ee1\u8db3\u6761\u4ef6\u7684\u7b54\u6848&#xff0c;\u8fd4\u56de\u7684\u662f\u6570\u503c\u800c\u4e0d\u662f\u4e0b\u6807\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LCR 179. \u67e5\u627e\u603b\u4ef7\u683c\u4e3a\u76ee\u6807\u503c\u7684\u4e24\u4e2a\u5546\u54c1<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u8fd9\u662f\u6709\u5e8f\u6570\u7ec4\u4e2d\u7684\u6807\u51c6\u76f8\u5411\u53cc\u6307\u9488\u3002left \u4ece\u6700\u5c0f\u503c\u5f00\u59cb&#xff0c;right \u4ece\u6700\u5927\u503c\u5f00\u59cb\u3002\u6bcf\u8f6e\u8ba1\u7b97\u4e24\u7aef\u4e4b\u548c&#xff1a;<\/p>\n<ul>\n<li>\u548c\u7b49\u4e8e target&#xff0c;\u76f4\u63a5\u8fd4\u56de\u4e24\u4e2a\u6570&#xff1b;<\/li>\n<li>\u548c\u5c0f\u4e8e target&#xff0c;\u9700\u8981\u8ba9\u548c\u53d8\u5927&#xff0c;\u6240\u4ee5\u79fb\u52a8 left&#xff0c;\u5c1d\u8bd5\u66f4\u5927\u7684\u6570&#xff1b;<\/li>\n<li>\u548c\u5927\u4e8e target&#xff0c;\u9700\u8981\u8ba9\u548c\u53d8\u5c0f&#xff0c;\u6240\u4ee5\u79fb\u52a8 right&#xff0c;\u5c1d\u8bd5\u66f4\u5c0f\u7684\u6570\u3002<\/li>\n<\/ul>\n<p>\u79fb\u52a8\u7406\u7531\u4f9d\u8d56\u4e8e\u6570\u7ec4\u6709\u5e8f\u3002\u5982\u679c\u5f53\u524d\u548c\u592a\u5c0f&#xff0c;\u79fb\u52a8 right \u53ea\u4f1a\u8ba9\u53f3\u4fa7\u6570\u53d8\u5c0f&#xff0c;\u7ed3\u679c\u4e0d\u53ef\u80fd\u53d8\u5927&#xff0c;\u56e0\u6b64\u5f53\u524d left \u4e0e\u8fd9\u4e2a right \u7684\u7ec4\u5408\u4ee5\u53ca\u66f4\u5c0f\u7684\u53f3\u4fa7\u7ec4\u5408\u90fd\u53ef\u4ee5\u6392\u9664&#xff1b;\u540c\u7406&#xff0c;\u548c\u592a\u5927\u65f6\u5e94\u6392\u9664\u5f53\u524d right\u3002<\/p>\n<p>\u5982\u679c\u6570\u7ec4\u65e0\u5e8f&#xff0c;\u5c31\u4e0d\u80fd\u76f4\u63a5\u5957\u7528\u8fd9\u5957\u65b9\u5411\u5224\u65ad\u3002\u65e0\u5e8f\u6570\u7ec4\u901a\u5e38\u9700\u8981\u54c8\u5e0c\u8868&#xff0c;\u6216\u8005\u5148\u6392\u5e8f\u5e76\u540c\u65f6\u4fdd\u7559\u539f\u4e0b\u6807&#xff1b;\u672c\u9898\u5df2\u7ecf\u6709\u5e8f&#xff0c;\u6240\u4ee5\u53cc\u6307\u9488\u53ef\u4ee5\u7528\u5e38\u6570\u7ea7\u989d\u5916\u7a7a\u95f4\u5b8c\u6210\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>class Solution {<br \/>\n    public int[] twoSum(int[] price, int target) {<br \/>\n        int left &#061; 0;<br \/>\n        int right &#061; price.length &#8211; 1;<\/p>\n<p>        while (left &lt; right) {<br \/>\n            int sum &#061; price[left] &#043; price[right];<\/p>\n<p>            if (sum &#061;&#061; target) {<br \/>\n                return new int[] {price[left], price[right]};<br \/>\n            } else if (sum &lt; target) {<br \/>\n                left&#043;&#043;;<br \/>\n            } else {<br \/>\n                right&#8211;;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        return new int[0];<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>left \u548c right \u59cb\u7ec8\u6307\u5411\u4e24\u4e2a\u4e0d\u540c\u4f4d\u7f6e&#xff0c;\u6240\u4ee5\u5faa\u73af\u6761\u4ef6\u4e3a left &lt; right\u3002\u5f53 sum &#061;&#061; target \u65f6&#xff0c;\u8fd4\u56de\u5305\u542b\u4e24\u4e2a\u4ef7\u683c\u7684\u6570\u7ec4&#xff0c;\u800c\u4e0d\u662f\u8fd4\u56de\u4e24\u4e2a\u4e0b\u6807\u3002<\/p>\n<p>\u4ee5 price &#061; [2, 7, 11, 15]\u3001target &#061; 9 \u4e3a\u4f8b&#xff0c;\u5f00\u59cb\u65f6 2 &#043; 15 &#061; 17&#xff0c;\u548c\u592a\u5927&#xff0c;\u53f3\u6307\u9488\u5411\u5de6\u79fb\u52a8&#xff1b;\u63a5\u7740 2 &#043; 11 &#061; 13 \u4ecd\u7136\u592a\u5927&#xff0c;\u53f3\u6307\u9488\u7ee7\u7eed\u79fb\u52a8&#xff1b;\u6700\u540e 2 &#043; 7 &#061; 9&#xff0c;\u8fd4\u56de [2, 7]\u3002<\/p>\n<p>\u65b9\u6cd5\u672b\u5c3e\u7684 return new int[0] \u662f\u4e3a\u4e86\u8986\u76d6\u201c\u6ca1\u6709\u627e\u5230\u7b54\u6848\u201d\u7684\u4ee3\u7801\u8def\u5f84\u3002\u9898\u76ee\u5982\u679c\u4fdd\u8bc1\u7b54\u6848\u5b58\u5728&#xff0c;\u6b63\u5e38\u6267\u884c\u65f6\u4f1a\u5728\u5faa\u73af\u4e2d\u8fd4\u56de&#xff1b;\u8fd9\u884c\u4e0d\u4f1a\u5f71\u54cd\u6838\u5fc3\u7b97\u6cd5\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;O(n)\u3002\u4e24\u4e2a\u6307\u9488\u90fd\u53ea\u5411\u5185\u79fb\u52a8&#xff0c;\u4e0d\u4f1a\u53cd\u590d\u56de\u9000\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O(1)&#xff0c;\u4e0d\u8ba1\u8fd4\u56de\u6570\u7ec4\u5360\u7528\u7684\u56fa\u5b9a\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>\u8fd9\u5957\u79fb\u52a8\u65b9\u5411\u5efa\u7acb\u5728\u6570\u7ec4\u6709\u5e8f\u7684\u524d\u63d0\u4e0a\u3002<\/li>\n<li>sum &lt; target \u65f6\u79fb\u52a8 left&#xff0c;sum &gt; target \u65f6\u79fb\u52a8 right\u3002<\/li>\n<li>left &lt; right \u4fdd\u8bc1\u4e0d\u4f1a\u91cd\u590d\u4f7f\u7528\u540c\u4e00\u4e2a\u4f4d\u7f6e\u3002<\/li>\n<li>LCR 179 \u8fd4\u56de\u7684\u662f\u4e24\u4e2a\u6570\u503c&#xff0c;\u4e0d\u662f\u4e0b\u6807&#xff1b;\u548c\u5176\u4ed6\u201c\u4e24\u6570\u4e4b\u548c\u201d\u9898\u76ee\u6df7\u6dc6\u65f6\u9700\u8981\u91cd\u65b0\u6838\u5bf9\u9898\u9762\u3002<\/li>\n<li>\u5982\u679c\u9898\u76ee\u7ea6\u675f\u4e2d\u7684\u6570\u503c\u53ef\u80fd\u4f7f\u4e24\u6570\u76f8\u52a0\u6ea2\u51fa int&#xff0c;\u53ef\u4ee5\u5c06 sum \u58f0\u660e\u4e3a long&#xff1b;\u5e38\u89c1\u7ea6\u675f\u4e0b int \u901a\u5e38\u8db3\u591f\u3002<\/li>\n<p>\u8fd9\u9053\u9898\u8ba9\u6211\u66f4\u6e05\u695a\u5730\u770b\u5230&#xff1a;\u76f8\u5411\u53cc\u6307\u9488\u7684\u5173\u952e\u4e0d\u662f\u201c\u5de6\u53f3\u5404\u653e\u4e00\u4e2a\u6307\u9488\u201d&#xff0c;\u800c\u662f\u6570\u7ec4\u6709\u5e8f\u540e&#xff0c;\u5f53\u524d\u548c\u7684\u5927\u5c0f\u80fd\u591f\u51b3\u5b9a\u54ea\u4e00\u4fa7\u4e0d\u518d\u6709\u53ef\u80fd\u3002<\/p>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u4e03\u300115. \u4e09\u6570\u4e4b\u548c<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u6574\u6570\u6570\u7ec4 nums&#xff0c;\u627e\u51fa\u6240\u6709\u548c\u4e3a 0 \u4e14\u4e0d\u91cd\u590d\u7684\u4e09\u5143\u7ec4 [nums[i], nums[left], nums[right]]\u3002\u4e09\u5143\u7ec4\u4e2d\u7684\u4e09\u4e2a\u5143\u7d20\u5fc5\u987b\u6765\u81ea\u4e09\u4e2a\u4e0d\u540c\u4e0b\u6807&#xff0c;\u7b54\u6848\u4e2d\u7684\u7ec4\u5408\u987a\u5e8f\u4e0d\u91cd\u8981\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u8f93\u5165 [-1, 0, 1, 2, -1, -4]&#xff0c;\u7ed3\u679c\u4e3a [[-1, -1, 2], [-1, 0, 1]]\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 15. \u4e09\u6570\u4e4b\u548c<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u4e09\u6570\u4e4b\u548c\u5982\u679c\u4f7f\u7528\u4e09\u5c42\u5faa\u73af&#xff0c;\u590d\u6742\u5ea6\u662f O(n\u00b3)\u3002\u6392\u5e8f\u540e\u56fa\u5b9a\u7b2c\u4e00\u4e2a\u6570&#xff0c;\u518d\u5728\u53f3\u4fa7\u533a\u95f4\u7528\u5de6\u53f3\u6307\u9488\u5bfb\u627e\u53e6\u5916\u4e24\u4e2a\u6570&#xff0c;\u53ef\u4ee5\u964d\u5230 O(n\u00b2)\u3002<\/p>\n<p>\u6b65\u9aa4\u5982\u4e0b&#xff1a;<\/p>\n<li>\u5148\u5c06\u6570\u7ec4\u5347\u5e8f\u6392\u5e8f\u3002<\/li>\n<li>\u7528 i \u56fa\u5b9a\u4e09\u5143\u7ec4\u4e2d\u7684\u7b2c\u4e00\u4e2a\u6570\u3002<\/li>\n<li>\u4ee4 left &#061; i &#043; 1\u3001right &#061; nums.length &#8211; 1&#xff0c;\u5728\u5269\u4f59\u533a\u95f4\u4e2d\u5bfb\u627e\u4e24\u6570\u4e4b\u548c -nums[i]\u3002<\/li>\n<li>\u8ba1\u7b97\u4e09\u6570\u548c&#xff1a;\n<ul>\n<li>\u548c\u5c0f\u4e8e 0&#xff0c;left&#043;&#043;&#xff0c;\u5c1d\u8bd5\u66f4\u5927\u7684\u6570&#xff1b;<\/li>\n<li>\u548c\u5927\u4e8e 0&#xff0c;right&#8211;&#xff0c;\u5c1d\u8bd5\u66f4\u5c0f\u7684\u6570&#xff1b;<\/li>\n<li>\u548c\u7b49\u4e8e 0&#xff0c;\u52a0\u5165\u7ed3\u679c&#xff0c;\u7136\u540e\u5de6\u53f3\u6307\u9488\u90fd\u79fb\u52a8\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u4e3a\u4e86\u4e0d\u91cd\u590d\u52a0\u5165\u76f8\u540c\u7b54\u6848&#xff0c;\u9700\u8981\u5728\u56fa\u5b9a\u5c42\u548c\u547d\u4e2d\u7b54\u6848\u540e\u5206\u522b\u53bb\u91cd\u3002<\/li>\n<p>\u201c\u53bb\u91cd\u201d\u5728\u8fd9\u91cc\u6307\u7684\u662f\u7b54\u6848\u503c\u4e0d\u80fd\u91cd\u590d&#xff0c;\u5e76\u4e0d\u662f\u8bf4\u6570\u7ec4\u4e2d\u76f8\u540c\u5143\u7d20\u53ea\u80fd\u4f7f\u7528\u4e00\u6b21\u3002\u6bd4\u5982 [-1, -1, 2] \u662f\u5408\u6cd5\u7b54\u6848&#xff0c;\u56e0\u4e3a\u4e24\u4e2a -1 \u6765\u81ea\u4e24\u4e2a\u4e0d\u540c\u4e0b\u6807\u3002\u771f\u6b63\u9700\u8981\u8df3\u8fc7\u7684\u662f&#xff1a;\u5f53\u67d0\u4e00\u5c42\u56fa\u5b9a\u7684\u503c\u4e0e\u4e0a\u4e00\u8f6e\u76f8\u540c&#xff0c;\u7ee7\u7eed\u4f7f\u7528\u5b83\u53ea\u4f1a\u751f\u6210\u5df2\u7ecf\u5904\u7406\u8fc7\u7684\u7b54\u6848\u3002<\/p>\n<p>\u56fa\u5b9a\u5c42\u53bb\u91cd\u5199\u6210 i &gt; 0 &amp;&amp; nums[i] &#061;&#061; nums[i &#8211; 1]\u3002\u627e\u5230\u4e00\u4e2a\u7b54\u6848\u540e&#xff0c;\u5148\u8ba9 left&#043;&#043; \u548c right&#8211; \u79bb\u5f00\u5f53\u524d\u7ec4\u5408&#xff0c;\u518d\u8df3\u8fc7\u65b0\u7684\u5de6\u53f3\u6307\u9488\u4e0e\u521a\u4f7f\u7528\u503c\u76f8\u540c\u7684\u5143\u7d20\u3002<\/p>\n<p>\u6392\u5e8f\u8fd8\u6709\u4e00\u4e2a\u989d\u5916\u4f5c\u7528&#xff1a;\u5982\u679c nums[i] &gt; 0&#xff0c;\u90a3\u4e48\u540e\u9762\u7684\u6570\u4e5f\u90fd\u5927\u4e8e\u96f6&#xff0c;\u4e09\u6570\u548c\u4e0d\u53ef\u80fd\u518d\u56de\u5230\u96f6&#xff0c;\u53ef\u4ee5\u63d0\u524d\u7ed3\u675f\u5916\u5c42\u5faa\u73af\u3002<\/p>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>import java.util.ArrayList;<br \/>\nimport java.util.Arrays;<br \/>\nimport java.util.List;<\/p>\n<p>class Solution {<br \/>\n    public List&lt;List&lt;Integer&gt;&gt; threeSum(int[] nums) {<br \/>\n        Arrays.sort(nums);<br \/>\n        List&lt;List&lt;Integer&gt;&gt; ret &#061; new ArrayList&lt;&gt;();<\/p>\n<p>        for (int i &#061; 0; i &lt; nums.length &#8211; 2; i&#043;&#043;) {<br \/>\n            if (i &gt; 0 &amp;&amp; nums[i] &#061;&#061; nums[i &#8211; 1]) {<br \/>\n                continue;<br \/>\n            }<br \/>\n            if (nums[i] &gt; 0) {<br \/>\n                break;<br \/>\n            }<\/p>\n<p>            int left &#061; i &#043; 1;<br \/>\n            int right &#061; nums.length &#8211; 1;<\/p>\n<p>            while (left &lt; right) {<br \/>\n                int sum &#061; nums[i] &#043; nums[left] &#043; nums[right];<\/p>\n<p>                if (sum &lt; 0) {<br \/>\n                    left&#043;&#043;;<br \/>\n                } else if (sum &gt; 0) {<br \/>\n                    right&#8211;;<br \/>\n                } else {<br \/>\n                    ret.add(Arrays.asList(nums[i], nums[left], nums[right]));<br \/>\n                    left&#043;&#043;;<br \/>\n                    right&#8211;;<\/p>\n<p>                    while (left &lt; right &amp;&amp; nums[left] &#061;&#061; nums[left &#8211; 1]) {<br \/>\n                        left&#043;&#043;;<br \/>\n                    }<br \/>\n                    while (left &lt; right &amp;&amp; nums[right] &#061;&#061; nums[right &#043; 1]) {<br \/>\n                        right&#8211;;<br \/>\n                    }<br \/>\n                }<br \/>\n            }<br \/>\n        }<\/p>\n<p>        return ret;<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>\u6392\u5e8f\u540e&#xff0c;\u4e09\u5143\u7ec4\u4f1a\u4ee5\u975e\u9012\u51cf\u987a\u5e8f\u51fa\u73b0&#xff0c;\u56e0\u6b64\u76f8\u540c\u7b54\u6848\u4e2d\u7684\u6570\u5b57\u6392\u5217\u4e5f\u7edf\u4e00\u4e86\u3002\u5916\u5c42\u5faa\u73af\u53ea\u9700\u8981\u4fdd\u8bc1 i \u53f3\u8fb9\u8fd8\u6709\u4e24\u4e2a\u4f4d\u7f6e&#xff0c;\u6240\u4ee5\u6761\u4ef6\u662f i &lt; nums.length &#8211; 2\u3002<\/p>\n<p>i &gt; 0 &amp;&amp; nums[i] &#061;&#061; nums[i &#8211; 1] \u53ea\u8df3\u8fc7\u540c\u4e00\u5c42\u4e2d\u8fde\u7eed\u91cd\u590d\u7684\u56fa\u5b9a\u503c&#xff0c;\u4e0d\u4f1a\u5f71\u54cd\u4f7f\u7528\u91cd\u590d\u6570\u5b57\u7ec4\u6210\u5408\u6cd5\u7b54\u6848\u3002\u6bd4\u5982\u6392\u5e8f\u540e\u7684 [-1, -1, 0, 1, 2]&#xff0c;\u7b2c\u4e00\u4e2a -1 \u5df2\u7ecf\u4f5c\u4e3a\u56fa\u5b9a\u503c\u641c\u7d22\u8fc7&#xff0c;\u7b2c\u4e8c\u4e2a -1 \u4f5c\u4e3a\u56fa\u5b9a\u503c\u65f6\u4f1a\u5f97\u5230\u540c\u6837\u7684\u7b54\u6848&#xff0c;\u56e0\u6b64\u8df3\u8fc7\u3002<\/p>\n<p>\u5728\u5de6\u53f3\u626b\u63cf\u4e2d&#xff0c;\u548c\u504f\u5c0f\u65f6\u5de6\u6307\u9488\u53f3\u79fb&#xff0c;\u548c\u504f\u5927\u65f6\u53f3\u6307\u9488\u5de6\u79fb\u3002\u547d\u4e2d\u7b54\u6848\u540e\u5fc5\u987b\u540c\u65f6\u79fb\u52a8\u4e24\u4e2a\u6307\u9488&#xff0c;\u5426\u5219\u4e0b\u4e00\u8f6e\u8fd8\u4f1a\u505c\u5728\u540c\u4e00\u7ec4\u6570\u4e0a\u3002\u79fb\u52a8\u540e\u518d\u8df3\u8fc7\u76f8\u540c\u503c&#xff0c;\u624d\u80fd\u907f\u514d [0, 0, 0, 0] \u4e4b\u7c7b\u7684\u6570\u636e\u4ea7\u751f\u91cd\u590d\u4e09\u5143\u7ec4\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;\u6392\u5e8f\u4e3a O(n log n)&#xff0c;\u5916\u5c42\u56fa\u5b9a\u4e00\u4e2a\u6570\u3001\u5185\u5c42\u53cc\u6307\u9488\u626b\u63cf\u4e3a O(n\u00b2)&#xff0c;\u603b\u590d\u6742\u5ea6\u4e3a O(n\u00b2)\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;\u4e0d\u8ba1\u8fd4\u56de\u7ed3\u679c\u65f6&#xff0c;\u4e3b\u8981\u662f\u6392\u5e8f\u53ef\u80fd\u4f7f\u7528\u7684\u6808\u7a7a\u95f4&#xff1b;\u7ed3\u679c\u5217\u8868\u5360\u7528\u7684\u7a7a\u95f4\u53d6\u51b3\u4e8e\u7b54\u6848\u6570\u91cf\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>\u56fa\u5b9a\u5c42\u53bb\u91cd\u5e94\u6bd4\u8f83 nums[i] \u548c nums[i &#8211; 1]&#xff0c;\u4e0d\u80fd\u6bd4\u8f83\u540e\u4e00\u4e2a\u4f4d\u7f6e&#xff0c;\u5426\u5219\u53ef\u80fd\u8df3\u8fc7\u5408\u6cd5\u7b54\u6848\u3002<\/li>\n<li>\u53ea\u6709\u547d\u4e2d\u7b54\u6848\u540e&#xff0c;\u624d\u9700\u8981\u4e13\u95e8\u8df3\u8fc7\u5de6\u53f3\u4e24\u4fa7\u7684\u91cd\u590d\u503c&#xff1b;\u548c\u504f\u5c0f\u65f6\u6216\u504f\u5927\u65f6\u6b63\u5e38\u79fb\u52a8\u5373\u53ef\u3002<\/li>\n<li>\u547d\u4e2d\u540e\u5fc5\u987b\u8ba9 left\u3001right \u540c\u65f6\u79fb\u52a8&#xff0c;\u5426\u5219\u53ef\u80fd\u6b7b\u5faa\u73af\u6216\u91cd\u590d\u52a0\u5165\u5f53\u524d\u7b54\u6848\u3002<\/li>\n<li>left &lt; right \u4fdd\u8bc1\u4e09\u4e2a\u4e0b\u6807\u4e92\u4e0d\u76f8\u540c\u3002<\/li>\n<li>\u8fd4\u56de\u7684\u662f\u6570\u503c\u7ec4\u5408&#xff0c;\u4e0d\u662f\u4e0b\u6807\u7ec4\u5408\u3002<\/li>\n<li>Arrays.sort(nums) \u4f1a\u6539\u53d8\u8f93\u5165\u6570\u7ec4&#xff1b;\u672c\u9898\u7684\u7b97\u6cd5\u5229\u7528\u4e86\u8fd9\u4e2a\u53d8\u5316\u3002<\/li>\n<li>\u672c\u9898\u76ee\u6807\u56fa\u5b9a\u4e3a 0&#xff0c;\u6240\u4ee5 nums[i] &gt; 0 \u65f6\u53ef\u4ee5\u63d0\u524d\u7ed3\u675f&#xff1b;\u8fd9\u4e2a\u526a\u679d\u4e0d\u80fd\u4e0d\u52a0\u5224\u65ad\u5730\u5957\u5230\u76ee\u6807\u503c\u4efb\u610f\u7684\u56db\u6570\u4e4b\u548c\u4e2d\u3002<\/li>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u516b\u300118. \u56db\u6570\u4e4b\u548c<\/h3>\n<p style=\"background-color:transparent\">\u9898\u76ee\u63cf\u8ff0<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u6574\u6570\u6570\u7ec4 nums \u548c\u76ee\u6807\u503c target&#xff0c;\u627e\u51fa\u6240\u6709\u603b\u548c\u7b49\u4e8e target \u4e14\u4e0d\u91cd\u590d\u7684\u56db\u5143\u7ec4 [nums[i], nums[j], nums[left], nums[right]]\u3002\u56db\u4e2a\u5143\u7d20\u5fc5\u987b\u6765\u81ea\u56db\u4e2a\u4e0d\u540c\u4e0b\u6807\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u8f93\u5165 nums &#061; [1, 0, -1, 0, -2, 2]\u3001target &#061; 0&#xff0c;\u7ed3\u679c\u4e3a [[-2, -1, 1, 2], [-2, 0, 0, 2], [-1, 0, 0, 1]]\u3002<\/p>\n<p style=\"background-color:transparent\">\u9898\u76ee\u94fe\u63a5<\/p>\n<p>LeetCode 18. \u56db\u6570\u4e4b\u548c<\/p>\n<p style=\"background-color:transparent\">\u7b97\u6cd5\u601d\u8def<\/p>\n<p>\u56db\u6570\u4e4b\u548c\u53ef\u4ee5\u770b\u6210\u4e09\u6570\u4e4b\u548c\u518d\u589e\u52a0\u4e00\u5c42\u56fa\u5b9a\u4e0b\u6807&#xff1a;\u5148\u6392\u5e8f&#xff0c;\u7528 i \u56fa\u5b9a\u7b2c\u4e00\u4e2a\u6570&#xff0c;\u7528 j \u56fa\u5b9a\u7b2c\u4e8c\u4e2a\u6570&#xff0c;\u518d\u7528 left \u548c right \u5728\u5269\u4f59\u533a\u95f4\u4e2d\u8fdb\u884c\u76f8\u5411\u626b\u63cf\u3002<\/p>\n<p>\u6d41\u7a0b\u662f&#xff1a;<\/p>\n<li>\u5347\u5e8f\u6392\u5e8f&#xff0c;\u4f7f\u79fb\u52a8\u65b9\u5411\u548c\u53bb\u91cd\u90fd\u6709\u4f9d\u636e\u3002<\/li>\n<li>\u5916\u5c42\u5faa\u73af\u56fa\u5b9a i&#xff0c;\u5e76\u8df3\u8fc7\u540c\u4e00\u5c42\u91cd\u590d\u7684 nums[i]\u3002<\/li>\n<li>\u5185\u5c42\u5faa\u73af\u56fa\u5b9a j&#xff0c;\u5e76\u53ea\u5728\u5f53\u524d i \u7684\u8303\u56f4\u5185\u8df3\u8fc7\u91cd\u590d\u7684 nums[j]\u3002<\/li>\n<li>\u4ee4 left &#061; j &#043; 1\u3001right &#061; nums.length &#8211; 1\u3002<\/li>\n<li>\u8ba1\u7b97\u56db\u6570\u548c&#xff1a;\n<ul>\n<li>\u548c\u5c0f\u4e8e target&#xff0c;\u5de6\u6307\u9488\u53f3\u79fb&#xff1b;<\/li>\n<li>\u548c\u5927\u4e8e target&#xff0c;\u53f3\u6307\u9488\u5de6\u79fb&#xff1b;<\/li>\n<li>\u548c\u7b49\u4e8e target&#xff0c;\u8bb0\u5f55\u7b54\u6848&#xff0c;\u5de6\u53f3\u6307\u9488\u5404\u79fb\u52a8\u4e00\u6b21&#xff0c;\u518d\u8df3\u8fc7\u91cd\u590d\u503c\u3002<\/li>\n<\/ul>\n<\/li>\n<p>\u8fd9\u91cc\u5fc5\u987b\u4f7f\u7528 long \u8ba1\u7b97 sum\u3002\u5373\u4f7f\u65b9\u6cd5\u53c2\u6570\u548c\u6570\u7ec4\u5143\u7d20\u662f int&#xff0c;\u56db\u4e2a\u63a5\u8fd1 1_000_000_000 \u7684\u6570\u76f8\u52a0\u4e5f\u53ef\u80fd\u8d85\u8fc7 int \u7684\u6700\u5927\u503c\u3002\u9700\u8981\u5728\u52a0\u6cd5\u5f00\u59cb\u524d\u8f6c\u6362\u7c7b\u578b&#xff1a;(long) nums[i] &#043; nums[j] &#043; nums[left] &#043; nums[right]\u3002\u5982\u679c\u53ea\u628a\u6700\u7ec8\u7ed3\u679c\u8d4b\u503c\u7ed9 long&#xff0c;\u800c\u52a0\u6cd5\u8fc7\u7a0b\u4ecd\u5168\u90e8\u662f int&#xff0c;\u6ea2\u51fa\u5df2\u7ecf\u53d1\u751f&#xff0c;\u540e\u7eed\u518d\u8f6c\u6362\u4e5f\u65e0\u6cd5\u6062\u590d\u3002<\/p>\n<p>\u56db\u5c42\u53bb\u91cd\u5206\u522b\u5bf9\u5e94&#xff1a;<\/p>\n<ul>\n<li>\u56fa\u5b9a i \u65f6\u8df3\u8fc7\u540c\u5c42\u91cd\u590d\u503c&#xff1b;<\/li>\n<li>\u56fa\u5b9a j \u65f6\u8df3\u8fc7\u540c\u4e00 i \u4e0b\u7684\u91cd\u590d\u503c&#xff1b;<\/li>\n<li>\u627e\u5230\u7b54\u6848\u540e\u8df3\u8fc7\u91cd\u590d\u7684 left \u503c&#xff1b;<\/li>\n<li>\u627e\u5230\u7b54\u6848\u540e\u8df3\u8fc7\u91cd\u590d\u7684 right \u503c\u3002<\/li>\n<\/ul>\n<p style=\"background-color:transparent\">Java\u4ee3\u7801<\/p>\n<p>import java.util.ArrayList;<br \/>\nimport java.util.Arrays;<br \/>\nimport java.util.List;<\/p>\n<p>class Solution {<br \/>\n    public List&lt;List&lt;Integer&gt;&gt; fourSum(int[] nums, int target) {<br \/>\n        Arrays.sort(nums);<br \/>\n        List&lt;List&lt;Integer&gt;&gt; ret &#061; new ArrayList&lt;&gt;();<\/p>\n<p>        for (int i &#061; 0; i &lt; nums.length &#8211; 3; i&#043;&#043;) {<br \/>\n            if (i &gt; 0 &amp;&amp; nums[i] &#061;&#061; nums[i &#8211; 1]) {<br \/>\n                continue;<br \/>\n            }<\/p>\n<p>            for (int j &#061; i &#043; 1; j &lt; nums.length &#8211; 2; j&#043;&#043;) {<br \/>\n                if (j &gt; i &#043; 1 &amp;&amp; nums[j] &#061;&#061; nums[j &#8211; 1]) {<br \/>\n                    continue;<br \/>\n                }<\/p>\n<p>                int left &#061; j &#043; 1;<br \/>\n                int right &#061; nums.length &#8211; 1;<\/p>\n<p>                while (left &lt; right) {<br \/>\n                    long sum &#061; (long) nums[i] &#043; nums[j]<br \/>\n                            &#043; nums[left] &#043; nums[right];<\/p>\n<p>                    if (sum &lt; target) {<br \/>\n                        left&#043;&#043;;<br \/>\n                    } else if (sum &gt; target) {<br \/>\n                        right&#8211;;<br \/>\n                    } else {<br \/>\n                        ret.add(Arrays.asList(<br \/>\n                                nums[i], nums[j], nums[left], nums[right]));<br \/>\n                        left&#043;&#043;;<br \/>\n                        right&#8211;;<\/p>\n<p>                        while (left &lt; right &amp;&amp; nums[left] &#061;&#061; nums[left &#8211; 1]) {<br \/>\n                            left&#043;&#043;;<br \/>\n                        }<br \/>\n                        while (left &lt; right &amp;&amp; nums[right] &#061;&#061; nums[right &#043; 1]) {<br \/>\n                            right&#8211;;<br \/>\n                        }<br \/>\n                    }<br \/>\n                }<br \/>\n            }<br \/>\n        }<\/p>\n<p>        return ret;<br \/>\n    }<br \/>\n}<\/p>\n<p style=\"background-color:transparent\">\u4ee3\u7801\u8bf4\u660e<\/p>\n<p>\u5916\u5c42 i \u53f3\u4fa7\u81f3\u5c11\u8981\u5269\u4e0b\u4e09\u4e2a\u5143\u7d20&#xff0c;\u6240\u4ee5\u5faa\u73af\u6761\u4ef6\u662f i &lt; nums.length &#8211; 3\u3002\u5185\u5c42 j \u53f3\u4fa7\u81f3\u5c11\u8981\u5269\u4e0b\u4e24\u4e2a\u5143\u7d20&#xff0c;\u6240\u4ee5\u6761\u4ef6\u662f j &lt; nums.length &#8211; 2\u3002<\/p>\n<p>j \u7684\u53bb\u91cd\u6761\u4ef6\u4e0d\u80fd\u7b80\u5355\u5199\u6210 j &gt; 0\u3002\u5f53 j &#061;&#061; i &#043; 1 \u65f6&#xff0c;\u5b83\u662f\u5f53\u524d\u56fa\u5b9a\u7684 i \u540e\u9762\u7b2c\u4e00\u4e2a\u5019\u9009\u4f4d\u7f6e&#xff0c;\u5373\u4f7f\u6570\u503c\u4e0e\u524d\u9762\u5176\u4ed6\u4f4d\u7f6e\u76f8\u540c&#xff0c;\u4e5f\u4e0d\u80fd\u8de8\u8d8a\u5f53\u524d i \u7684\u8fb9\u754c\u53bb\u8df3\u8fc7\u3002\u6b63\u786e\u7684\u5224\u65ad\u662f j &gt; i &#043; 1 &amp;&amp; nums[j] &#061;&#061; nums[j &#8211; 1]&#xff0c;\u8868\u793a\u53ea\u8df3\u8fc7\u540c\u4e00\u4e2a i \u4e0b\u5df2\u7ecf\u5904\u7406\u8fc7\u7684\u7b2c\u4e8c\u4e2a\u6570\u3002<\/p>\n<p>\u76f8\u5411\u626b\u63cf\u90e8\u5206\u548c\u4e09\u6570\u4e4b\u548c\u76f8\u540c&#xff1a;\u548c\u5c0f\u5c31\u9700\u8981\u589e\u5927\u5de6\u4fa7\u6570\u5b57&#xff0c;\u548c\u5927\u5c31\u9700\u8981\u51cf\u5c0f\u53f3\u4fa7\u6570\u5b57\u3002\u547d\u4e2d\u540e\u540c\u65f6\u79fb\u52a8\u5de6\u53f3\u6307\u9488&#xff0c;\u518d\u8df3\u8fc7\u91cd\u590d\u6570\u503c\u3002<\/p>\n<p>\u56db\u4e2a\u4e0b\u6807\u59cb\u7ec8\u6ee1\u8db3 i &lt; j &lt; left &lt; right&#xff0c;\u6240\u4ee5\u4e0d\u4f1a\u91cd\u590d\u4f7f\u7528\u540c\u4e00\u4e2a\u6570\u7ec4\u4f4d\u7f6e\u3002\u6392\u5e8f\u540e\u52a0\u5165\u7ed3\u679c\u7684\u56db\u4e2a\u6570\u5929\u7136\u662f\u975e\u9012\u51cf\u987a\u5e8f&#xff0c;\u7b54\u6848\u7684\u8868\u793a\u4e5f\u7edf\u4e00\u4e86\u3002<\/p>\n<p style=\"background-color:transparent\">\u590d\u6742\u5ea6\u4e0e\u6613\u9519\u70b9<\/p>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;\u6392\u5e8f\u4e3a O(n log n)&#xff0c;\u4e24\u5c42\u56fa\u5b9a\u4e0b\u6807\u7ea6\u4e3a O(n\u00b2)&#xff0c;\u6bcf\u7ec4\u56fa\u5b9a\u4e0b\u6807\u7528\u53cc\u6307\u9488\u626b\u63cf\u4e3a O(n)&#xff0c;\u603b\u590d\u6742\u5ea6\u4e3a O(n\u00b3)\u3002<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;\u4e0d\u8ba1\u8fd4\u56de\u7ed3\u679c\u65f6&#xff0c;\u4e3b\u8981\u662f\u6392\u5e8f\u53ef\u80fd\u4f7f\u7528\u7684\u6808\u7a7a\u95f4&#xff1b;\u7ed3\u679c\u5217\u8868\u5360\u7528\u7684\u7a7a\u95f4\u53d6\u51b3\u4e8e\u7b54\u6848\u6570\u91cf\u3002<\/li>\n<\/ul>\n<p>\u6613\u9519\u70b9\u5305\u62ec&#xff1a;<\/p>\n<li>\u56db\u6570\u548c\u8ba1\u7b97\u5fc5\u987b\u5728\u52a0\u6cd5\u5f00\u59cb\u524d\u4f7f\u7528 long&#xff0c;\u63a8\u8350\u5199\u6210 long sum &#061; (long) nums[i] &#043; nums[j] &#043; nums[left] &#043; nums[right]\u3002<\/li>\n<li>i\u3001j \u4e24\u4e2a\u56fa\u5b9a\u5c42\u90fd\u8981\u53bb\u91cd&#xff0c;\u547d\u4e2d\u540e left\u3001right \u4e5f\u8981\u53bb\u91cd\u3002<\/li>\n<li>j \u7684\u53bb\u91cd\u6761\u4ef6\u662f j &gt; i &#043; 1&#xff0c;\u4e0d\u80fd\u5199\u6210\u53ea\u5224\u65ad j &gt; 0\u3002<\/li>\n<li>\u547d\u4e2d\u7b54\u6848\u540e\u8981\u540c\u65f6\u79fb\u52a8\u5de6\u53f3\u6307\u9488&#xff0c;\u5426\u5219\u4f1a\u505c\u5728\u539f\u7ec4\u5408\u4e0a\u3002<\/li>\n<li>\u56db\u4e2a\u4f4d\u7f6e\u5fc5\u987b\u4e25\u683c\u9012\u589e&#xff0c;\u4e0d\u80fd\u4f7f\u7528\u540c\u4e00\u4e2a\u4e0b\u6807\u4e24\u6b21\u3002<\/li>\n<li>\u8fd9\u91cc\u7684 target \u4e0d\u4e00\u5b9a\u662f 0&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u7167\u642c\u4e09\u6570\u4e4b\u548c\u4e2d nums[i] &gt; 0 \u5c31\u7ed3\u675f\u7684\u6761\u4ef6\u3002<\/li>\n<li>\u5148\u4fdd\u8bc1\u57fa\u7840\u79fb\u52a8\u548c\u53bb\u91cd\u903b\u8f91\u6b63\u786e&#xff0c;\u518d\u8003\u8651\u4e0a\u4e0b\u754c\u526a\u679d&#xff1b;\u526a\u679d\u6761\u4ef6\u5982\u679c\u6ca1\u6709\u540c\u6b65\u5904\u7406\u7c7b\u578b\u8303\u56f4&#xff0c;\u53cd\u800c\u53ef\u80fd\u5f15\u5165\u9519\u8bef\u3002<\/li>\n<hr \/>\n<h3 style=\"background-color:transparent\">\u4e5d\u3001\u516b\u9053\u9898\u653e\u5728\u4e00\u8d77\u770b&#xff1a;\u53cc\u6307\u9488\u89c4\u5f8b\u7684\u5f52\u7eb3<\/h3>\n<h4 style=\"background-color:transparent\">1. \u5feb\u6162\u6307\u9488\u4e0d\u53ea\u662f\u4e00\u79cd\u5199\u6cd5<\/h4>\n<p>283 \u79fb\u52a8\u96f6\u4e2d\u7684\u4e24\u4e2a\u6307\u9488\u90fd\u4ece\u5de6\u5411\u53f3&#xff0c;\u4f46\u4e00\u4e2a\u8d1f\u8d23\u8bfb\u53d6\u3001\u4e00\u4e2a\u8d1f\u8d23\u5199\u5165&#xff1b;202 \u5feb\u4e50\u6570\u4e2d\u7684\u4e24\u4e2a\u6307\u9488\u4e5f\u90fd\u6cbf\u7740\u540c\u4e00\u6761\u72b6\u6001\u8def\u7ebf\u524d\u8fdb&#xff0c;\u4f46\u4e00\u4e2a\u8d70\u4e00\u6b65\u3001\u4e00\u4e2a\u8d70\u4e24\u6b65&#xff1b;1089 \u590d\u5199\u96f6\u5219\u662f\u4ece\u53f3\u5411\u5de6\u5b8c\u6210\u8bfb\u5199\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u73b0\u5728\u4e0d\u518d\u53ea\u6309\u53d8\u91cf\u540d\u8bb0\u5fc6\u201c\u5feb\u6162\u6307\u9488\u201d&#xff0c;\u800c\u662f\u5148\u95ee\u4e24\u4e2a\u6307\u9488\u5404\u81ea\u4ee3\u8868\u4ec0\u4e48&#xff1a;<\/p>\n<ul>\n<li>\u662f\u4e0d\u662f\u4e00\u4e2a\u8d1f\u8d23\u8bfb\u3001\u4e00\u4e2a\u8d1f\u8d23\u5199&#xff1f;<\/li>\n<li>\u662f\u5426\u5b58\u5728\u4f1a\u91cd\u590d\u51fa\u73b0\u7684\u72b6\u6001&#xff1f;<\/li>\n<li>\u5199\u5165\u662f\u5426\u4f1a\u8ba9\u6570\u636e\u53d8\u957f&#xff0c;\u4ece\u800c\u8986\u76d6\u5c1a\u672a\u8bfb\u53d6\u7684\u5185\u5bb9&#xff1f;<\/li>\n<\/ul>\n<p>\u6307\u9488\u7684\u79fb\u52a8\u65b9\u5411\u548c\u901f\u5ea6&#xff0c;\u90fd\u662f\u7531\u8fd9\u4e2a\u804c\u8d23\u51b3\u5b9a\u7684\u3002<\/p>\n<h4 style=\"background-color:transparent\">2. \u5de6\u53f3\u6307\u9488\u7684\u524d\u63d0\u662f\u80fd\u591f\u6392\u9664\u4e0d\u53ef\u80fd\u60c5\u51b5<\/h4>\n<p>LCR 179 \u4e2d&#xff0c;\u6570\u7ec4\u6709\u5e8f\u4f7f\u5f97\u201c\u548c\u5c0f\u589e\u5927\u5de6\u7aef\u3001\u548c\u5927\u51cf\u5c0f\u53f3\u7aef\u201d\u6210\u7acb&#xff1b;11 \u76db\u6700\u591a\u6c34\u7684\u5bb9\u5668\u4e2d&#xff0c;\u77ed\u677f\u548c\u5bbd\u5ea6\u7684\u5173\u7cfb\u4f7f\u5f97\u79fb\u52a8\u957f\u8fb9\u6ca1\u6709\u673a\u4f1a\u8d85\u8fc7\u5f53\u524d\u9762\u79ef&#xff1b;611 \u6709\u6548\u4e09\u89d2\u5f62\u7684\u4e2a\u6570\u4e2d&#xff0c;\u6392\u5e8f\u540e\u7684\u4e0d\u7b49\u5f0f\u8ba9\u4e00\u6b21\u5224\u65ad\u80fd\u591f\u6279\u91cf\u8ba1\u6570\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;\u770b\u5230\u4e24\u4e2a\u8fb9\u754c\u5e76\u4e0d\u610f\u5473\u7740\u4e00\u5b9a\u80fd\u7528\u53cc\u6307\u9488\u3002\u9700\u8981\u8fdb\u4e00\u6b65\u786e\u8ba4&#xff1a;\u79fb\u52a8\u4e00\u4fa7\u540e&#xff0c;\u662f\u5426\u771f\u7684\u80fd\u6392\u9664\u4e00\u6279\u5019\u9009&#xff0c;\u5e76\u4e14\u4e0d\u4f1a\u9519\u8fc7\u7b54\u6848\u3002<\/p>\n<h4 style=\"background-color:transparent\">3. \u6392\u5e8f\u65e2\u662f\u4e3a\u4e86\u79fb\u52a8&#xff0c;\u4e5f\u662f\u4e3a\u4e86\u53bb\u91cd<\/h4>\n<p>611\u300115\u300118 \u90fd\u5148\u6392\u5e8f&#xff0c;\u4f46\u4f7f\u7528\u6392\u5e8f\u7684\u65b9\u5f0f\u4e0d\u5b8c\u5168\u76f8\u540c&#xff1a;<\/p>\n<ul>\n<li>\u4e09\u89d2\u5f62\u4e2a\u6570\u5229\u7528\u6709\u5e8f\u5173\u7cfb\u6279\u91cf\u589e\u52a0\u7b54\u6848&#xff1b;<\/li>\n<li>\u4e09\u6570\u4e4b\u548c\u5229\u7528\u548c\u7684\u5927\u5c0f\u79fb\u52a8\u5de6\u53f3\u6307\u9488&#xff0c;\u5e76\u5bf9\u56fa\u5b9a\u6570\u548c\u547d\u4e2d\u540e\u7684\u5de6\u53f3\u503c\u53bb\u91cd&#xff1b;<\/li>\n<li>\u56db\u6570\u4e4b\u548c\u5728\u4e09\u6570\u4e4b\u548c\u57fa\u7840\u4e0a\u591a\u56fa\u5b9a\u4e00\u5c42&#xff0c;\u56e0\u6b64\u591a\u4e86\u4e00\u5c42 j \u7684\u53bb\u91cd\u3002<\/li>\n<\/ul>\n<p>\u6392\u5e8f\u8fd8\u4f1a\u6539\u53d8\u8f93\u5165\u6570\u7ec4\u539f\u6765\u7684\u987a\u5e8f&#xff0c;\u8fd9\u4e9b\u9898\u7684\u9898\u610f\u5141\u8bb8\u8fd9\u79cd\u53d8\u5316\u3002\u82e5\u9898\u76ee\u8981\u6c42\u4fdd\u7559\u539f\u6570\u7ec4\u987a\u5e8f&#xff0c;\u5c31\u9700\u8981\u91cd\u65b0\u8003\u8651\u662f\u5426\u53ef\u4ee5\u6392\u5e8f\u3002<\/p>\n<h4>4. \u53bb\u91cd\u662f\u201c\u540c\u4e00\u5c42\u4e0d\u91cd\u590d\u201d&#xff0c;\u4e0d\u662f\u201c\u76f8\u540c\u6570\u5b57\u4e0d\u80fd\u4f7f\u7528\u201d<\/h4>\n<p>\u5728\u4e09\u6570\u4e4b\u548c\u548c\u56db\u6570\u4e4b\u548c\u4e2d&#xff0c;\u76f8\u540c\u6570\u503c\u6765\u81ea\u4e0d\u540c\u4e0b\u6807\u65f6\u4ecd\u7136\u53ef\u80fd\u7ec4\u6210\u5408\u6cd5\u7b54\u6848\u3002\u4f8b\u5982\u4e24\u4e2a 0 \u53ef\u4ee5\u540c\u65f6\u53c2\u4e0e\u4e00\u4e2a\u7b54\u6848\u3002\u53bb\u91cd\u9488\u5bf9\u7684\u662f\u201c\u540c\u4e00\u4e2a\u503c\u7ec4\u5408\u5df2\u7ecf\u88ab\u8bb0\u5f55\u8fc7\u201d&#xff0c;\u800c\u4e0d\u662f\u628a\u91cd\u590d\u5143\u7d20\u5168\u90e8\u5220\u9664\u3002<\/p>\n<ul>\n<li>\u5916\u5c42\u56fa\u5b9a\u503c&#xff1a;\u4e0e\u540c\u5c42\u524d\u4e00\u4e2a\u503c\u76f8\u540c\u5c31\u8df3\u8fc7&#xff1b;<\/li>\n<li>\u5185\u5c42\u56fa\u5b9a\u503c&#xff1a;\u53ea\u5728\u540c\u4e00\u4e2a\u5916\u5c42\u56fa\u5b9a\u503c\u8303\u56f4\u5185\u8df3\u8fc7&#xff1b;<\/li>\n<li>\u5de6\u53f3\u626b\u63cf\u547d\u4e2d\u540e&#xff1a;\u8df3\u8fc7\u4e0e\u521a\u521a\u4f7f\u7528\u7684\u6570\u503c\u76f8\u540c\u7684\u6307\u9488\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p>611 \u5219\u4e0d\u540c&#xff0c;\u56e0\u4e3a\u5b83\u7edf\u8ba1\u4e0b\u6807\u7ec4\u5408\u7684\u6570\u91cf&#xff0c;\u76f8\u540c\u8fb9\u957f\u5bf9\u5e94\u4e0d\u540c\u4e0b\u6807\u65f6\u9700\u8981\u5206\u522b\u8ba1\u6570&#xff0c;\u4e0d\u80fd\u4f7f\u7528\u4e09\u6570\u4e4b\u548c\u7684\u53bb\u91cd\u65b9\u5f0f\u3002<\/p>\n<h4>5. \u6570\u503c\u8303\u56f4\u4f1a\u5f71\u54cd\u6307\u9488\u9898\u7684\u6b63\u786e\u6027<\/h4>\n<p>18 \u56db\u6570\u4e4b\u548c\u4e2d&#xff0c;\u6307\u9488\u65b9\u5411\u672c\u8eab\u6ca1\u6709\u95ee\u9898&#xff0c;\u4f46\u5982\u679c\u56db\u4e2a int \u5148\u76f8\u52a0\u5e76\u6ea2\u51fa&#xff0c;sum \u7684\u5927\u5c0f\u5c31\u4f1a\u53d8\u9519&#xff0c;\u540e\u9762\u7684\u79fb\u52a8\u4e5f\u4f1a\u8ddf\u7740\u9519\u3002\u4f7f\u7528 long \u65f6&#xff0c;\u7c7b\u578b\u8f6c\u6362\u5fc5\u987b\u53d1\u751f\u5728\u7b2c\u4e00\u6b21\u52a0\u6cd5\u4e4b\u524d\u3002<\/p>\n<p>\u8fd9\u63d0\u9192\u6211&#xff0c;\u7b97\u6cd5\u903b\u8f91\u548c Java \u7c7b\u578b\u8303\u56f4\u9700\u8981\u4e00\u8d77\u68c0\u67e5\u3002\u4ee3\u7801\u770b\u8d77\u6765\u7b26\u5408\u53cc\u6307\u9488\u6a21\u677f&#xff0c;\u5e76\u4e0d\u4ee3\u8868\u5728\u6240\u6709\u6570\u503c\u8303\u56f4\u4e0b\u90fd\u5b89\u5168\u3002<\/p>\n<hr \/>\n<h3>\u5341\u3001\u8fd9\u4e00\u7ec4\u9898\u5f62\u6210\u7684\u5224\u65ad\u987a\u5e8f<\/h3>\n<p>\u73b0\u5728\u9047\u5230\u4e00\u4e2a\u53ef\u80fd\u4f7f\u7528\u53cc\u6307\u9488\u7684\u95ee\u9898\u65f6&#xff0c;\u6211\u4f1a\u6309\u4e0b\u9762\u7684\u987a\u5e8f\u5224\u65ad&#xff1a;<\/p>\n<li>\u5148\u786e\u8ba4\u76ee\u6807\u662f\u4ec0\u4e48\u3002 \u662f\u628a\u67d0\u7c7b\u5143\u7d20\u96c6\u4e2d\u5230\u4e00\u4fa7\u3001\u5b8c\u6210\u539f\u5730\u8bfb\u5199\u3001\u5224\u65ad\u72b6\u6001\u662f\u5426\u6210\u73af&#xff0c;\u8fd8\u662f\u5bfb\u627e\u6ee1\u8db3\u5173\u7cfb\u7684\u4e24\u4e2a\u6216\u591a\u4e2a\u6570\u3002<\/li>\n<li>\u518d\u8bf4\u660e\u6bcf\u4e2a\u6307\u9488\u7684\u542b\u4e49\u3002 \u4e00\u4e2a\u6307\u9488\u662f\u8bfb\u3001\u4e00\u4e2a\u662f\u5199&#xff0c;\u8fd8\u662f\u5de6\u53f3\u8fb9\u754c&#xff0c;\u6216\u8005\u662f\u72b6\u6001\u5e8f\u5217\u4e2d\u901f\u5ea6\u4e0d\u540c\u7684\u4e24\u4e2a\u4f4d\u7f6e\u3002<\/li>\n<li>\u68c0\u67e5\u6570\u636e\u662f\u5426\u6709\u5e8f&#xff0c;\u6216\u8005\u662f\u5426\u53ef\u4ee5\u5148\u6392\u5e8f\u3002 \u53ea\u6709\u5b58\u5728\u987a\u5e8f\u548c\u5355\u8c03\u6027&#xff0c;\u624d\u53ef\u80fd\u6839\u636e\u5f53\u524d\u7ed3\u679c\u51b3\u5b9a\u79fb\u52a8\u65b9\u5411\u3002<\/li>\n<li>\u5199\u51fa\u79fb\u52a8\u4f9d\u636e\u3002 \u548c\u5c0f\u4e86\u4e3a\u4ec0\u4e48\u5de6\u79fb&#xff0c;\u548c\u5927\u4e86\u4e3a\u4ec0\u4e48\u53f3\u79fb&#xff1b;\u77ed\u677f\u4e3a\u4ec0\u4e48\u9700\u8981\u66f4\u6362&#xff1b;\u6761\u4ef6\u6210\u7acb\u65f6\u4e3a\u4ec0\u4e48\u53ef\u4ee5\u6279\u91cf\u8ba1\u6570\u3002<\/li>\n<li>\u786e\u5b9a\u5faa\u73af\u8fb9\u754c\u3002 \u4e24\u4e2a\u6307\u9488\u80fd\u5426\u6307\u5411\u540c\u4e00\u4f4d\u7f6e&#xff0c;\u901a\u5e38\u51b3\u5b9a\u4f7f\u7528 &lt; \u8fd8\u662f &lt;&#061;&#xff1b;\u56fa\u5b9a\u4e86\u51e0\u4e2a\u6570&#xff0c;\u4e5f\u51b3\u5b9a\u5269\u4f59\u533a\u95f4\u81f3\u5c11\u8981\u7559\u51e0\u4e2a\u4f4d\u7f6e\u3002<\/li>\n<li>\u68c0\u67e5\u662f\u5426\u9700\u8981\u53bb\u91cd\u3002 \u8fd4\u56de\u6240\u6709\u6570\u503c\u7ec4\u5408\u65f6\u901a\u5e38\u8981\u5904\u7406\u91cd\u590d\u7b54\u6848&#xff1b;\u7edf\u8ba1\u4e0b\u6807\u7ec4\u5408\u65f6&#xff0c;\u91cd\u590d\u6570\u503c\u4e0d\u4e00\u5b9a\u9700\u8981\u8df3\u8fc7\u3002<\/li>\n<li>\u68c0\u67e5\u5199\u5165\u65b9\u5411\u548c\u8986\u76d6\u98ce\u9669\u3002 \u539f\u5730\u6269\u5c55\u5199\u5165\u65f6&#xff0c;\u524d\u5411\u5199\u662f\u5426\u4f1a\u8986\u76d6\u672a\u8bfb\u6570\u636e&#xff1b;\u5982\u679c\u4f1a&#xff0c;\u5c31\u8003\u8651\u4ece\u540e\u5411\u524d\u3002<\/li>\n<li>\u68c0\u67e5\u7c7b\u578b\u548c\u8fb9\u754c\u3002 \u591a\u4e2a\u6574\u6570\u76f8\u52a0\u662f\u5426\u53ef\u80fd\u6ea2\u51fa&#xff0c;\u7a7a\u6570\u7ec4\u3001\u77ed\u6570\u7ec4\u3001\u5168\u96f6\u3001\u5168\u91cd\u590d\u7b49\u60c5\u51b5\u662f\u5426\u4f1a\u8ba9\u6307\u9488\u521d\u59cb\u5316\u6216\u5faa\u73af\u6761\u4ef6\u5931\u6548\u3002<\/li>\n<li>\u6700\u540e\u6838\u5bf9\u590d\u6742\u5ea6\u3002 \u7edf\u8ba1\u6bcf\u4e2a\u6307\u9488\u603b\u5171\u79fb\u52a8\u591a\u5c11\u6b21&#xff0c;\u533a\u5206\u6392\u5e8f\u6210\u672c\u3001\u5916\u5c42\u56fa\u5b9a\u6210\u672c\u548c\u7ed3\u679c\u8f93\u51fa\u6210\u672c\u3002<\/li>\n<p>\u8fd9\u516b\u9053\u9898\u653e\u5728\u4e00\u8d77\u540e&#xff0c;\u53cc\u6307\u9488\u5bf9\u6211\u4eec\u6765\u8bf4\u4e0d\u518d\u662f\u5355\u72ec\u7684\u4e00\u7ec4\u56fa\u5b9a\u4ee3\u7801&#xff0c;\u800c\u662f\u4e00\u79cd\u5229\u7528\u804c\u8d23\u3001\u987a\u5e8f\u3001\u5355\u8c03\u6027\u548c\u6392\u9664\u5173\u7cfb\u6765\u51cf\u5c11\u91cd\u590d\u641c\u7d22\u7684\u65b9\u6cd5\u3002\u4ee3\u7801\u4e2d\u7684 left&#043;&#043;\u3001right&#8211; \u6216 slow&#043;&#043; \u53ea\u6709\u5728\u79fb\u52a8\u7406\u7531\u6e05\u695a\u65f6\u624d\u771f\u6b63\u53ef\u9760\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u5165&#xff1a;\u53cc\u6307\u9488\u5230\u5e95\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898<br \/>\n\u6211\u76ee\u524d\u5bf9\u201c\u53cc\u6307\u9488\u201d\u7684\u7406\u89e3\u662f&#xff1a;\u5728\u904d\u5386\u6570\u7ec4\u3001\u6570\u5b57\u72b6\u6001\u6216\u5019\u9009\u533a\u95f4\u65f6&#xff0c;\u540c\u65f6\u7ef4\u62a4\u4e24\u4e2a\u4f1a\u79fb\u52a8\u7684\u4f4d\u7f6e&#xff0c;\u5e76\u8ba9\u5b83\u4eec\u627f\u62c5\u4e0d\u540c\u7684\u804c\u8d23\u3002\u8fd9\u6837\u505a\u7684\u4ef7\u503c\u4e0d\u53ea\u662f\u4ee3\u7801\u91cc\u51fa\u73b0\u4e86\u4e24\u4e2a\u53d8\u91cf&#xff0c;\u800c\u662f\u6bcf\u6b21\u79fb\u52a8\u90fd\u80fd\u6839\u636e\u9898\u76ee\u7684\u89c4\u5f8b\u6392\u9664\u4e00\u6279\u4e0d\u53ef\u80fd\u7684\u60c5\u51b5&#xff0c;\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u679a\u4e3e\u3002<br \/>\n\u5f88\u591a\u76f4\u63a5\u679a\u4e3e\u7684\u5199\u6cd5\u4f1a\u4ea7\u751f\u4e24\u5c42\u3001\u4e09\u5c42\u751a\u81f3\u56db\u5c42\u5faa\u73af\u3002\u53cc\u6307\u9488\u5e76\u4e0d\u80fd\u628a\u6240\u6709\u95ee\u9898\u90fd\u53d8\u6210\u7ebf\u6027\u590d\u6742\u5ea6&#xff0c;\u4f46\u5728\u6570\u636e\u6709\u5e8f\u3001\u7ed3\u679c\u5177\u6709\u5355\u8c03\u6027&amp;#xf<\/p>\n","protected":false},"author":2,"featured_media":99261,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,2692,1813,305,427],"topic":[],"class_list":["post-99262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-leetcode","tag-1813","tag-305","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/99262.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5f15\u5165&#xff1a;\u53cc\u6307\u9488\u5230\u5e95\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898 \u6211\u76ee\u524d\u5bf9\u201c\u53cc\u6307\u9488\u201d\u7684\u7406\u89e3\u662f&#xff1a;\u5728\u904d\u5386\u6570\u7ec4\u3001\u6570\u5b57\u72b6\u6001\u6216\u5019\u9009\u533a\u95f4\u65f6&#xff0c;\u540c\u65f6\u7ef4\u62a4\u4e24\u4e2a\u4f1a\u79fb\u52a8\u7684\u4f4d\u7f6e&#xff0c;\u5e76\u8ba9\u5b83\u4eec\u627f\u62c5\u4e0d\u540c\u7684\u804c\u8d23\u3002\u8fd9\u6837\u505a\u7684\u4ef7\u503c\u4e0d\u53ea\u662f\u4ee3\u7801\u91cc\u51fa\u73b0\u4e86\u4e24\u4e2a\u53d8\u91cf&#xff0c;\u800c\u662f\u6bcf\u6b21\u79fb\u52a8\u90fd\u80fd\u6839\u636e\u9898\u76ee\u7684\u89c4\u5f8b\u6392\u9664\u4e00\u6279\u4e0d\u53ef\u80fd\u7684\u60c5\u51b5&#xff0c;\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u679a\u4e3e\u3002 \u5f88\u591a\u76f4\u63a5\u679a\u4e3e\u7684\u5199\u6cd5\u4f1a\u4ea7\u751f\u4e24\u5c42\u3001\u4e09\u5c42\u751a\u81f3\u56db\u5c42\u5faa\u73af\u3002\u53cc\u6307\u9488\u5e76\u4e0d\u80fd\u628a\u6240\u6709\u95ee\u9898\u90fd\u53d8\u6210\u7ebf\u6027\u590d\u6742\u5ea6&#xff0c;\u4f46\u5728\u6570\u636e\u6709\u5e8f\u3001\u7ed3\u679c\u5177\u6709\u5355\u8c03\u6027&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99262.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T01:32:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902013254-6a977cc65556c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99262.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99262.html\",\"name\":\"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-02T01:32:55+00:00\",\"dateModified\":\"2026-09-02T01:32:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99262.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99262.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99262.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/99262.html","og_locale":"zh_CN","og_type":"article","og_title":"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5f15\u5165&#xff1a;\u53cc\u6307\u9488\u5230\u5e95\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898 \u6211\u76ee\u524d\u5bf9\u201c\u53cc\u6307\u9488\u201d\u7684\u7406\u89e3\u662f&#xff1a;\u5728\u904d\u5386\u6570\u7ec4\u3001\u6570\u5b57\u72b6\u6001\u6216\u5019\u9009\u533a\u95f4\u65f6&#xff0c;\u540c\u65f6\u7ef4\u62a4\u4e24\u4e2a\u4f1a\u79fb\u52a8\u7684\u4f4d\u7f6e&#xff0c;\u5e76\u8ba9\u5b83\u4eec\u627f\u62c5\u4e0d\u540c\u7684\u804c\u8d23\u3002\u8fd9\u6837\u505a\u7684\u4ef7\u503c\u4e0d\u53ea\u662f\u4ee3\u7801\u91cc\u51fa\u73b0\u4e86\u4e24\u4e2a\u53d8\u91cf&#xff0c;\u800c\u662f\u6bcf\u6b21\u79fb\u52a8\u90fd\u80fd\u6839\u636e\u9898\u76ee\u7684\u89c4\u5f8b\u6392\u9664\u4e00\u6279\u4e0d\u53ef\u80fd\u7684\u60c5\u51b5&#xff0c;\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u679a\u4e3e\u3002 \u5f88\u591a\u76f4\u63a5\u679a\u4e3e\u7684\u5199\u6cd5\u4f1a\u4ea7\u751f\u4e24\u5c42\u3001\u4e09\u5c42\u751a\u81f3\u56db\u5c42\u5faa\u73af\u3002\u53cc\u6307\u9488\u5e76\u4e0d\u80fd\u628a\u6240\u6709\u95ee\u9898\u90fd\u53d8\u6210\u7ebf\u6027\u590d\u6742\u5ea6&#xff0c;\u4f46\u5728\u6570\u636e\u6709\u5e8f\u3001\u7ed3\u679c\u5177\u6709\u5355\u8c03\u6027&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/99262.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-02T01:32:55+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902013254-6a977cc65556c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99262.html","url":"https:\/\/www.wsisp.com\/helps\/99262.html","name":"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-02T01:32:55+00:00","dateModified":"2026-09-02T01:32:55+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99262.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99262.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99262.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u53cc\u6307\u9488\u7b97\u6cd5 \u9898\u89e3\u603b\u7ed3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=99262"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99262\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/99261"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99262"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}