{"id":68253,"date":"2026-01-29T23:25:28","date_gmt":"2026-01-29T15:25:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/68253.html"},"modified":"2026-01-29T23:25:28","modified_gmt":"2026-01-29T15:25:28","slug":"leetcode%e5%88%b7%e9%a2%98%e4%b9%8b%e8%bd%ae%e8%bd%ac%e6%95%b0%e7%bb%84%e7%9a%84%e4%b8%89%e5%a4%a7%e8%a7%a3%e6%b3%95%e5%8f%8a%e5%af%b9%e6%af%94","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/68253.html","title":{"rendered":"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260129152527-697b7be773206.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><font size=\"5\">\u65b9\u6cd51&#xff1a;\u66b4\u529b\u9006\u7f6e<\/font><\/p>\n<p>\/\/\u8f6e\u8f6ck\u4e2a\u4f4d\u7f6e&#xff0c;\u5c31\u662f\u8bf4\u660e\u6bcf\u4e2a\u5143\u7d20\u90fd\u5e73\u5747\u5411\u540e\u79fb\u52a8\u4e86K\u6b21&#xff0c;\u603b\u5171\u79fb\u52a8\u6b21\u6570\u7b49\u4e8e\u5143\u7d20\u4e2a\u6570*k<\/p>\n<p>\/\/\u89e3\u6cd51&#xff0c;\u8bbe\u6570\u7ec4\u5143\u7d20\u4e3a1,2,3,4,5&#xff0c;\u5f53k\u4e3a3\u65f6&#xff0c;5\u4e2a\u5143\u7d20\u79fb\u52a81\u6b21\u53d8\u6210&#xff1a;5&#xff0c;1,2,3,4&#xff1b;\u79fb\u52a8\u7b2c2\u6b21\u53d8\u6210&#xff1a;4,5,1,2,3<br \/>\n\/\/\u79fb\u52a8\u7b2c3\u6b21\u53d8\u6210&#xff1a;3,4,5,1,2&#xff0c;\u5373\u79fb\u52a8\u4e00\u6b21&#xff0c;\u76f8\u5f53\u4e8e\u6240\u6709\u6570\u7ec4\u5143\u7d20\u90fd\u79fb\u52a8\u4e86\u4e00\u6b21&#xff0c;\u603b\u79fb\u52a8\u4e865\u6b21&#xff1b;\u79fb\u52a8\u7b2c\u4e8c\u6b21&#xff0c;\u76f8\u5f53\u4e8e\u6240\u6709\u6570\u7ec4\u5143\u7d20\u79fb\u52a8\u4e86\u4e00\u6b21&#xff0c;\u52a0\u4e0a\u524d\u4e00\u6b21\u79fb\u52a8\u7684&#xff0c;\u603b\u79fb\u52a810\u6b21&#xff1b;\u79fb\u52a8\u7b2c\u4e09\u6b21&#xff0c;\u76f8\u5f53\u4e8e\u6240\u6709\u6570\u7ec4\u5143\u7d20\u79fb\u52a8\u4e86\u4e00\u6b21&#xff0c;\u52a0\u4e0a\u524d\u4e00\u6b21\u79fb\u52a8\u7684&#xff0c;\u603b\u79fb\u52a815\u6b21&#xff0c;\u5f97\u51fa\u603b\u7684\u5faa\u73af\u4e2d\u6267\u884c\u6b21\u6570\u7b49\u4e8e\u79fb\u52a8\u6b21\u6570\u7b49\u4e8ekn,\u5373\u65f6\u95f4\u590d\u6742\u5ea6\u4e3ao(kn)&#061;o(n)<\/p>\n<p>\/\/\u5f53k\u8fdc\u5c0f\u4e8en\u65f6&#xff0c;\u6bd4\u5982k\u662f\u5e38\u6570&#xff0c;\u90a3\u4e48k\u53ef\u4ee5\u7701\u7565&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6\u53d8\u4e3aO(n);\u5f53k\u63a5\u8fd1n\u65f6&#xff0c;\u6bd4\u5982k&#061;(n-1),\u65f6\u95f4\u590d\u6742\u5ea6\u53d8\u4e3a<br \/>\n\/\/o(&#xff08;n-1&#xff09;*n),(n-1)*n&#061;&#061;n\u65b9\u51cfn,\u800c\u5927O\u4e0d\u5173\u5fc3\u5177\u4f53\u503c&#xff0c;\u53ea\u5173\u5fc3\u4f30\u7b97&#xff0c;\u6240\u4ee5\u5f53n\u4e3a1000000\u65f6&#xff0c;\u5e73\u65b9\u4e3a 10000<br \/>\n0000,n\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1&#xff0c;\u6240\u4ee5\u5927o\u91cc\u9762\u7559\u4e0b\u4e86&#xff08;n\u65b9&#xff09;&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6\u4e3ao&#xff08;n\u7684\u5e73\u65b9&#xff09;&#xff08;&#xff0c;\u6267\u884c\u6b21\u6570n\u8d8a\u5927&#xff0c;\u6548\u7387\u8d8a\u4f4e&#xff09;<\/p>\n<p>\/\/\u5f53k\u7b49\u4e8en\u65f6&#xff0c;\u6216\u8005\u8bf4k%n&#061;0,\u90a3\u4e48\u5c31\u76f8\u5f53\u4e8e1\u6b21\u4e5f\u6ca1\u8f6e\u8f6c\u5c31\u89e3\u51b3\u4e86\u95ee\u9898&#xff0c;n\u8d8a\u5927&#xff0c;\u8f6e\u8f6c\u6b21\u6570\u8ba4\u4e3a0&#xff0c;\u6548\u7387\u4e0d\u53d8&#xff0c;\u56e0\u4e3ak%n&#061;&#061;0,\u65f6\u95f4\u590d\u6742\u5ea6\u4e3ao(1)<\/p>\n<p><font color=\"#CD5C5C\" size=\"5\">\u73b0\u5728\u7528\u7684\u7b97\u6cd5\u6700\u574f\u60c5\u51b5\u8fbe\u5230o(n\u65b9)&#xff0c;\u6700\u597d\u60c5\u51b5o(1),\u6781\u5176\u4e0d\u7a33\u5b9a&#xff0c;\u5230\u8fbeo(n\u65b9\u65f6)&#xff0c;\u6548\u7387\u975e\u5e38\u4f4e\u4e0b&#xff0c;\u5177\u4f53\u4ee3\u7801\u5982\u4e0b<\/font><\/p>\n<p>k &#061; k % numsSize;<br \/>\n\/\/\u5f53k&lt;numsSize,\u4f8b\u59823&lt;7;\u5219k&#061;3%7&#061;3,\u8ddf\u9898\u76ee\u8981\u6c42\u7684\u4e09\u4e00\u6837&#xff0c;\u63a5\u7740\u5f80\u4e0b\u4ea4\u6362&#xff1b;k&gt;numsSize,10&gt;7,\u5219k&#061;10%7&#061;3&#xff0c;<br \/>\n\u4e5f\u8ddf\u9898\u76ee\u8981\u6c42\u7684\u4e09\u4e00\u6837&#xff1b;<br \/>\n\/\/\u63a5\u7740\u5f80\u4e0b\u4ea4\u6362&#xff1b;\u53ea\u6709\u7279\u6b8a\u60c5\u51b5&#xff0c;k&#061;&#061;numsSize, 7&#061;&#061;7\u65f6&#xff0c;\u53ef\u4ee5\u4e0d\u4ea4\u6362&#xff0c;\u76f4\u63a5\u63d0\u524d\u9000\u51fa\u7a0b\u5e8f<br \/>\nif (k &#061;&#061; numsSize)<br \/>\n{<br \/>\n    return;<br \/>\n}<br \/>\nint i &#061; 0;<br \/>\nint j &#061; 0;<br \/>\nint N &#061; numsSize &#8211; 1;\/\/N\u662f\u6570\u7ec4\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u4e0b\u6807<br \/>\nfor (i &#061; 0; i &lt; k; i&#043;&#043;)<br \/>\n{<br \/>\n    int num &#061; nums[N];<br \/>\n    for (j &#061; N &#8211; 1; j &gt;&#061; 0; j&#8211;)\/\/\u8981\u60f3\u4ece\u524d\u5f80\u540e\u8d4b\u503c\u5e76\u4fdd\u8bc1\u6570\u636e\u6700\u540e\u5b8c\u6574&#xff0c;\u5219\u8981\u4ece\u5012\u6570\u7b2c\u4e8c\u4e2a\u4e0b\u6807\u5f00\u59cb&#xff0c;\u5012\u6570\u7b2c\u4e8c\u4e2a\u4e0b\u6807<br \/>\n    \u8d4b\u7ed9\u6700\u540e\u4e00\u4e2a\u4e0b\u6807\u503c\u91cc\u7684\u6570\u636e&#xff0c;\u63a5\u7740\u5012\u6570\u7b2c\u4e09\u4e2a\u4e0b\u6807\u8d4b\u7ed9\u5012\u6570\u7b2c\u4e8c\u4e2a\u4e0b\u6807\u91cc\u7684\u6570\u636e<br \/>\n    {<br \/>\n        nums[j &#043; 1] &#061; nums[j];<\/p>\n<p>    }<br \/>\n    nums[0] &#061; num;<br \/>\n}<\/p>\n<p><font size=\"5\">\u65b9\u6cd52&#xff1a;\u6700\u4f18\u89e3\u6cd5&#xff1a;\u4e09\u6bb5\u9006\u7f6e<\/font><br \/>\nvoid rotate(int* nums, int numsSize, int k)<br \/>\n{<\/p>\n<p>\/\/\u5148\u9006\u8f6c\u6570\u7ec4\u7684\u5168\u90e8\u5143\u7d20&#xff0c;\u4f7f\u6570\u7ec4\u5b8c\u5168\u5012\u8fc7\u6765&#xff0c;\u4f8b\u5982&#xff1a;1&#xff0c;2,3,4,5;\u7b2c\u4e00\u6bb5\u9006\u7f6e\u7ed3\u679c&#xff1a;5&#xff0c;4,3,2,1&#xff1b;\u7b2c\u4e8c\u6bb5\u9006\u8f6c&#xff0c;<br \/>\n\u9006\u8f6c\u6570\u7ec4\u7684\u524dk\u4e2a\u4f4d\u7f6e&#xff1b;\u7b2c\u4e09\u6bb5\u9006\u8f6c&#xff0c;\u9006\u8f6c\u6570\u7ec4\u7684\u540en-k\u4e2a\u4f4d\u7f6e<\/p>\n<p><font color=\"#CD5C5C\" size=\"5\">\u7b2c\u4e00\u6bb5\u9006\u8f6c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3ao(n):\u9006\u8f6cnumsSize\/n\u4e2a\u6570\u7ec4\u5143\u7d20&#xff1b;\u7b2c\u4e8c\u6bb5\u9006\u8f6c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3ao(k):\u9006\u8f6c\u6570\u7ec4\u524dk\u4e2a\u5143\u7d20&#xff1b;\u7b2c\u4e09\u6bb5\u9006\u8f6c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3ao(n-k)&#xff0c;\u9006\u8f6c\u6570\u7ec4\u540en-k\u4e2a\u5143\u7d20\u3002\u628a\u65f6\u95f4\u590d\u6742\u5ea6\u76f8\u52a0&#xff0c;\u5f97\u5230o(n&#043;k&#043;n-k)&#061;o(2n)&#061;o(n),\u5373\u89e3\u6cd52\u7684\u6548\u7387\u8fdc\u5927\u4e8e\u89e3\u6cd51<\/font><\/p>\n<p>\/\/\u5148\u7b2c\u4e00\u6bb5\u9006\u8f6c<br \/>\nk &#061; k % numsSize;\/\/\u8fd9\u91cc\u8ba9k\u53bb\u53d6\u4f59&#xff0c;\u6709\u4e24\u4e2a\u76ee\u7684&#xff0c;\u2460\u82e5k\u5927\u4e8e\u6570\u7ec4\u5143\u7d20\u4e2a\u6570&#xff0c;\u5219K\u5bf9\u6570\u7ec4\u4e2a\u6570\u53d6\u4f59\u5f97\u5230\u771f\u6b63\u8981\u9006\u8f6c\u6570\u7ec4\u7684\u6b21\u6570<br \/>\n\/\/\u2461.\u82e5k&#061;&#061;\u6570\u7ec4\u5143\u7d20\u4e2a\u6570&#xff0c;\u5219\u4e0d\u9700\u8981\u9006\u8f6c\u6570\u7ec4&#xff0c;\u76f4\u63a5\u8fd4\u56de<br \/>\nif (k &#061;&#061; numsSize)<br \/>\n{<br \/>\nreturn;<br \/>\n}<br \/>\n\/\/\u5426\u5219k\u5927\u4e8enumsSize\u6216\u5c0f\u4e8enumsSize\u7684\u60c5\u51b5\u90fd\u8981\u4e09\u6b21\u9006\u8f6c<br \/>\nint i &#061; 0;<br \/>\nint N &#061; numsSize &#8211; 1;\/\/N\u662f\u6570\u7ec4\u7684\u6700\u540e\u4e00\u4e2a\u4e0b\u6807<br \/>\nint left &#061; 0;<br \/>\nint right &#061; N;<br \/>\nwhile (left &lt; right)<br \/>\n{<br \/>\nint temp &#061; nums[left];<br \/>\nnums[left] &#061; nums[right];<br \/>\nnums[right] &#061; temp;<br \/>\nleft&#043;&#043;;<br \/>\nright\u2013;<\/p>\n<p>}<br \/>\nleft &#061; 0;<br \/>\nright &#061; k &#8211; 1;<\/p>\n<p>\/\/\u63a5\u7740\u7b2c\u4e8c\u6bb5\u9006\u8f6c<br \/>\n\/\/\u6ce8\u610fleft&#xff0c;right\u51fa\u4e86\u5faa\u73af\u7684\u503c\u4e0d\u4f1a\u6d88\u5931&#xff0c;\u4f1a\u4fdd\u7559\u5faa\u73af\u91cc\u9762\u8ba1\u7b97\u53d8\u5316\u800c\u6765\u7684\u503c&#xff0c;\u800c\u662f\u51fa\u4e86main\u51fd\u6570&#xff0c;\u503c\u624d\u4f1a\u6d88\u5931&#xff0c;\u6240\u4ee5\u6bcf\u6b21<br \/>\n\/\/\u5faa\u73af\u7528left,right ,left&#xff0c;right\u5fc5\u987b\u66f4\u65b0&#xff0c;\u91cd\u65b0\u8d4b\u503c&#xff0c;\u4e0d\u80fd\u7528\u65e7\u503c<br \/>\nwhile (left &lt; right)<br \/>\n{<br \/>\n    int temp &#061; nums[left];<br \/>\n    nums[left] &#061; nums[right];<br \/>\n    nums[right] &#061; temp;<br \/>\n    left&#043;&#043;;<br \/>\n    right&#8211;;<\/p>\n<p>}<\/p>\n<p>\/\/\u7b2c\u4e09\u6bb5\u9006\u8f6c<br \/>\nleft &#061; k;<br \/>\nright &#061; N;<br \/>\nwhile (left &lt; right)<br \/>\n{<br \/>\n    int temp &#061; nums[left];<br \/>\n    nums[left] &#061; nums[right];<br \/>\n    nums[right] &#061; temp;<br \/>\n    left&#043;&#043;;<br \/>\n    right&#8211;;<\/p>\n<p>}<\/p>\n<p><font size=\"5\">\u65b9\u6cd53&#xff1a;\u6570\u7ec4\u62f7\u8d1d<\/font><br \/>\n\/\/\u65cb\u8f6c\u6570\u7ec4\u65b9\u6cd5\u4e09&#xff1a;\u6570\u7ec4\u62f7\u8d1d&#xff0c;\u7528memcpy\u5185\u5b58\u62f7\u8d1d\u51fd\u6570&#xff1a;\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u76ee\u7684\u5730\u5740&#xff0c;\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u8981\u62f7\u8d1d\u7684\u6570\u636e\u7684\u9996\u5730\u5740&#xff0c;\u7b2c\u4e09\u4e2a\u53c2\u6570\u8981\u62f7\u8d1d\u591a\u5c11\u4e2a\u5b57\u8282\u6570<\/p>\n<p><font color=\"#CD5C5C\" size=\"5\">\u9996\u5148&#xff0c;\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u7ec4&#xff0c;\u7528\u53d8\u957f\u6570\u7ec4&#xff0c;\u90a3\u4e48\u7a7a\u95f4\u590d\u6742\u5ea6&#xff08;\u4e3a\u89e3\u51b3\u95ee\u9898\u6240\u5f00\u8f9f\u7684\u53d8\u91cf\u4e2a\u6570&#xff09;\u5c31\u4e3ao(n),\u65f6\u95f4\u590d\u6742\u5ea6\u6267\u884c\u62f7\u8d1d3\u6b21o(k&#043;n-k&#043;n)&#061;o(n)&#xff0c;\u89e3\u6cd5\u4e09\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u89e3\u6cd52\u4e00\u6837\u662fo(n),\u6548\u7387\u8fdc\u9ad8\u4e8e\u89e3\u6cd51&#xff0c;\u4f46\u662f\u89e3\u6cd5\u4e09\u7684\u7a7a\u95f4\u590d\u6742\u5ea6\u6bd4\u89e3\u6cd5\u4e8c\u5927&#xff0c;\u6d88\u8017\u7684\u7a7a\u95f4\u66f4\u5927\u4e00\u4e9b&#xff0c;\u6240\u4ee5\u89e3\u6cd5\u4e8c\u662f\u6700\u4f18\u89e3\u6cd5<\/font><\/p>\n<p>\/\/\u601d\u8def&#xff0c;\u521b\u5efa\u65b0\u6570\u7ec4&#xff0c;\u5c06\u65e7\u6570\u7ec4\u91cc\u7684\u540ek\u4e2a\u5143\u7d20&#xff08;\u4e0b\u6807\u4ecen-k\u5f00\u59cb&#xff09;\u5148\u62f7\u8d1d\u5230\u65b0\u6570\u7ec4\u91cc\u9762&#xff0c;\u7136\u540e\u5c06\u65e7\u6570\u7ec4\u91cc\u7684\u524dn-k&#xff08;\u4e0b\u6807\u4ece\u65e7\u6570<br \/>\n\u7ec4\u9996\u5143\u7d20\u5730\u5740\u5f00\u59cb&#xff09;\u4e2a\u5143\u7d20\u62f7\u8d1d\u5230\u65b0\u6570\u7ec4\u540e\u9762&#xff0c;\u6700\u540e\u5c06\u65b0\u6570\u7ec4\u7684\u9996\u5730\u5740\u5f00\u59cb\u628a\u6240\u6709\u5143\u7d20\u62f7\u8d1d\u5230\u65e7\u6570\u7ec4\u91cc\u5b8c\u6210\u66ff\u6362\u6570\u7ec4<\/p>\n<p>k &#061; k % numsSize;<br \/>\nif (k &#061;&#061; numsSize)<br \/>\n{<br \/>\nreturn;<br \/>\n}<br \/>\nint emp[numsSize];<br \/>\nmemcpy(emp, nums &#043; (numsSize &#8211; k), sizeof(int) * k);<br \/>\nmemcpy(emp &#043; k, nums, sizeof(int) * (numsSize &#8211; k));<br \/>\nmemcpy(nums, emp, sizeof(int) * numsSize);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd51&#xff1a;\u66b4\u529b\u9006\u7f6e<br \/>\n\/\/\u8f6e\u8f6ck\u4e2a\u4f4d\u7f6e&#xff0c;\u5c31\u662f\u8bf4\u660e\u6bcf\u4e2a\u5143\u7d20\u90fd\u5e73\u5747\u5411\u540e\u79fb\u52a8\u4e86K\u6b21&#xff0c;\u603b\u5171\u79fb\u52a8\u6b21\u6570\u7b49\u4e8e\u5143\u7d20\u4e2a\u6570*k\/\/\u89e3\u6cd51&#xff0c;\u8bbe\u6570\u7ec4\u5143\u7d20\u4e3a1,2,3,4,5&#xff0c;\u5f53k\u4e3a3\u65f6&#xff0c;5\u4e2a\u5143\u7d20\u79fb\u52a81\u6b21\u53d8\u6210&#xff1a;5&#xff0c;1,2,3,4&#xff1b;\u79fb\u52a8\u7b2c2\u6b21\u53d8\u6210&#xff1a;4,5,1,2,3<br \/>\n\/\/\u79fb\u52a8\u7b2c3\u6b21\u53d8\u6210&#xff1a;3,4,5,1,2&#xff0c;\u5373\u79fb\u52a8\u4e00\u6b21&#xff0c;\u76f8\u5f53\u4e8e\u6240\u6709<\/p>\n","protected":false},"author":2,"featured_media":68252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2692,427],"topic":[],"class_list":["post-68253","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-leetcode","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4 - \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\/68253.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u65b9\u6cd51&#xff1a;\u66b4\u529b\u9006\u7f6e \/\/\u8f6e\u8f6ck\u4e2a\u4f4d\u7f6e&#xff0c;\u5c31\u662f\u8bf4\u660e\u6bcf\u4e2a\u5143\u7d20\u90fd\u5e73\u5747\u5411\u540e\u79fb\u52a8\u4e86K\u6b21&#xff0c;\u603b\u5171\u79fb\u52a8\u6b21\u6570\u7b49\u4e8e\u5143\u7d20\u4e2a\u6570*k\/\/\u89e3\u6cd51&#xff0c;\u8bbe\u6570\u7ec4\u5143\u7d20\u4e3a1,2,3,4,5&#xff0c;\u5f53k\u4e3a3\u65f6&#xff0c;5\u4e2a\u5143\u7d20\u79fb\u52a81\u6b21\u53d8\u6210&#xff1a;5&#xff0c;1,2,3,4&#xff1b;\u79fb\u52a8\u7b2c2\u6b21\u53d8\u6210&#xff1a;4,5,1,2,3 \/\/\u79fb\u52a8\u7b2c3\u6b21\u53d8\u6210&#xff1a;3,4,5,1,2&#xff0c;\u5373\u79fb\u52a8\u4e00\u6b21&#xff0c;\u76f8\u5f53\u4e8e\u6240\u6709\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/68253.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-29T15:25:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260129152527-697b7be773206.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/68253.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/68253.html\",\"name\":\"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-29T15:25:28+00:00\",\"dateModified\":\"2026-01-29T15:25:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/68253.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/68253.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/68253.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4\"}]},{\"@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":"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4 - \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\/68253.html","og_locale":"zh_CN","og_type":"article","og_title":"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u65b9\u6cd51&#xff1a;\u66b4\u529b\u9006\u7f6e \/\/\u8f6e\u8f6ck\u4e2a\u4f4d\u7f6e&#xff0c;\u5c31\u662f\u8bf4\u660e\u6bcf\u4e2a\u5143\u7d20\u90fd\u5e73\u5747\u5411\u540e\u79fb\u52a8\u4e86K\u6b21&#xff0c;\u603b\u5171\u79fb\u52a8\u6b21\u6570\u7b49\u4e8e\u5143\u7d20\u4e2a\u6570*k\/\/\u89e3\u6cd51&#xff0c;\u8bbe\u6570\u7ec4\u5143\u7d20\u4e3a1,2,3,4,5&#xff0c;\u5f53k\u4e3a3\u65f6&#xff0c;5\u4e2a\u5143\u7d20\u79fb\u52a81\u6b21\u53d8\u6210&#xff1a;5&#xff0c;1,2,3,4&#xff1b;\u79fb\u52a8\u7b2c2\u6b21\u53d8\u6210&#xff1a;4,5,1,2,3 \/\/\u79fb\u52a8\u7b2c3\u6b21\u53d8\u6210&#xff1a;3,4,5,1,2&#xff0c;\u5373\u79fb\u52a8\u4e00\u6b21&#xff0c;\u76f8\u5f53\u4e8e\u6240\u6709","og_url":"https:\/\/www.wsisp.com\/helps\/68253.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-29T15:25:28+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260129152527-697b7be773206.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/68253.html","url":"https:\/\/www.wsisp.com\/helps\/68253.html","name":"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-29T15:25:28+00:00","dateModified":"2026-01-29T15:25:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/68253.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/68253.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/68253.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"leetcode\u5237\u9898\u4e4b\u8f6e\u8f6c\u6570\u7ec4\u7684\u4e09\u5927\u89e3\u6cd5\u53ca\u5bf9\u6bd4"}]},{"@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\/68253","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=68253"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/68253\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/68252"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=68253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=68253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=68253"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=68253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}