{"id":64211,"date":"2026-01-23T01:04:26","date_gmt":"2026-01-22T17:04:26","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/64211.html"},"modified":"2026-01-23T01:04:26","modified_gmt":"2026-01-22T17:04:26","slug":"leetcode260-%e5%8f%aa%e5%87%ba%e7%8e%b0%e4%b8%80%e6%ac%a1%e7%9a%84%e6%95%b0%e5%ad%97iii","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/64211.html","title":{"rendered":"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III"},"content":{"rendered":"<h2>\u9898\u76ee\u94fe\u63a5<\/h2>\n<p>260. \u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57 III &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<\/p>\n<h2>\u9898\u76ee\u7406\u89e3<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u4e0d\u96be\u7406\u89e3&#xff0c;\u6bd4\u5982[1,2,1,3,2,5]\u4e2d&#xff0c;3\u548c5\u53ea\u51fa\u73b0\u8fc7\u4e00\u6b21&#xff0c;\u56e0\u6b64\u8f93\u51fa3\u548c5\u3002\u4e3b\u8981\u96be\u70b9\u5728\u89e3\u9898\u601d\u8def&#xff0c;\u8fd9\u91cc\u4e0d\u8fc7\u591a\u89e3\u91ca\u3002<\/p>\n<h2>\u89e3\u9898\u601d\u8def<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u8fd9\u9053\u9898\u548c\u5e73\u65f6\u89c1\u5230\u7684\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57\u4e0d\u540c\u3002\u56e0\u4e3a\u8fd9\u6b21\u6211\u4eec\u6709\u4e24\u4e2a\u6570\u5b57\u4e4b\u51fa\u73b0\u4e86\u4e00\u6b21\u3002\u56e0\u6b64\u6211\u4eec\u4e0d\u80fd\u5c06\u6570\u5b57\u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\u540e\u53d6\u6a21\u3002\u4e0b\u9762\u6211\u4eec\u770b\u4e00\u4e0b\u8fd9\u9053\u9898\u600e\u4e48\u89e3&#xff1a;<\/p>\n<h3>step1.\u5168\u90e8\u5f02\u6216<\/h3>\n<p>1 ^ 2 ^ 1 ^ 3 ^ 2 ^ 5<br \/>\n&#061; (1^1) ^ (2^2) ^ (3^5)  \/\/ \u6210\u5bf9\u7684\u4e92\u76f8\u62b5\u6d88\u4e86&#xff01;<br \/>\n&#061; 0 ^ 0 ^ (3^5)<br \/>\n&#061; 3 ^ 5<br \/>\n&#061; 6 <\/p>\n<p>\u8fd9\u91cc\u76846\u662f3\u548c5\u5f02\u6216\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u628a 3 \u548c 5 \u5199\u6210\u4e8c\u8fdb\u5236&#xff1a;<\/p>\n<ul>\n<li>\n<p>3 \u2192 011<\/p>\n<\/li>\n<li>\n<p>5 \u2192 101<\/p>\n<\/li>\n<\/ul>\n<p>\u5b83\u4eec\u5f02\u6216\u5f97\u5230 6 \u2192 110<\/p>\n<p>\u5173\u952e\u89c2\u5bdf&#xff1a;6 \u7684\u4e8c\u8fdb\u5236\u00a0110\u00a0\u4e2d&#xff0c;\u7b2c\u4e8c\u4f4d\u7684\u00a01\u00a0\u8868\u793a 3 \u548c 5 \u5728\u8fd9\u4e2a\u4f4d\u7f6e\u4e0d\u540c&#xff01;(\u5176\u5b9e\u7b2c\u4e09\u4f4d\u76841\u4e5f\u8868\u793a3\u548c5\u5728\u90a3\u4e00\u4f4d\u4e0a\u4e0d\u540c&#xff0c;\u4f46\u6211\u4eec\u901a\u5e38\u53d6\u6700\u4f4e\u4f4d\u76841)<\/p>\n<ul>\n<li>\n<p>3 \u7684\u7b2c\u4e8c\u4f4d\u662f 1<\/p>\n<\/li>\n<li>\n<p>5 \u7684\u7b2c\u4e8c\u4f4d\u662f 0<\/p>\n<\/li>\n<\/ul>\n<p>\u5f02\u6216\u4e0d\u4f1a\u8ba1\u7b97\u7684\u540c\u5b66\u53bb\u590d\u4e60\u4e00\u4e0b&#xff0c;\u8fd9\u91cc\u4e0d\u591a\u8d58\u8ff0\u4e86\u3002<\/p>\n<hr \/>\n<h3>step2.\u627e\u5f02\u6216\u7ed3\u679c\u6700\u4f4e\u4f4d\u76841<\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u00a0mix &amp; (-mix)\u00a0\u80fd\u83b7\u53d6\u4e00\u4e2a\u6570\u5b57\u4e8c\u8fdb\u5236\u8868\u793a\u4e2d\u6700\u4f4e\u4f4d\u7684 1<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-x\u00a0\u64cd\u4f5c\u7684\u5b9e\u9645\u542b\u4e49&#xff1a;<\/p>\n<p>int x &#061; 6;  \/\/ \u8ba1\u7b97\u673a\u4e2d\u5b58\u50a8&#xff1a;0000 0110&#xff08;\u8865\u7801&#xff09;<\/p>\n<p>\/\/ \u5f53\u4f60\u5199 -x \u65f6&#xff0c;\u8ba1\u7b97\u673a\u505a\u7684\u4e8b\u60c5&#xff1a;<br \/>\nint y &#061; -x;  \/\/ \u8ba1\u7b97\u8fc7\u7a0b&#xff1a;<br \/>\n              \/\/ 1. \u53d6x\u7684\u8865\u7801&#xff1a;0000 0110<br \/>\n              \/\/ 2. \u6309\u4f4d\u53d6\u53cd&#xff1a;1111 1001<br \/>\n              \/\/ 3. \u52a01&#xff1a;1111 1010<br \/>\n              \/\/ \u7ed3\u679c&#xff1a;\u8fd9\u5c31\u662f-6\u7684\u8865\u7801\u8868\u793a&#xff01; <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u56e0\u6b64 mix &amp; (-mix) \u5373\u4e3a0000 0010&#xff0c;\u8fd9\u6b63\u662f 6 \u7684\u6700\u4f4e\u4f4d\u7684 1\u3002<\/p>\n<hr \/>\n<h3>step3.\u5206\u5bb6\u6cd5<\/h3>\n<p>\u7528\u7b2c\u4e8c\u4f4d\u4f5c\u4e3a&#034;\u5206\u5bb6\u6807\u51c6&#034;&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e8c\u4f4d\u662f 1 \u7684\u7ad9\u5de6\u8fb9<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u4f4d\u662f 0 \u7684\u7ad9\u53f3\u8fb9<\/p>\n<\/li>\n<\/ul>\n<p>\u68c0\u67e5\u6bcf\u4e2a\u6570\u5b57&#xff1a;<\/p>\n<table align=\"center\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:350px\">\n<tbody>\n<tr>\n<td>\u6570\u5b57<\/td>\n<td>\u4e8c\u8fdb\u5236<\/td>\n<td>\u7b2c\u4e8c\u4f4d<\/td>\n<td>\u53bb\u54ea\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>001<\/td>\n<td>0<\/td>\n<td>\u53f3\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>010<\/td>\n<td>0<\/td>\n<td>\u5de6\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>001<\/td>\n<td>0<\/td>\n<td>\u53f3\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>011<\/td>\n<td>1<\/td>\n<td>\u5de6\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>010<\/td>\n<td>1<\/td>\n<td>\u5de6\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>101<\/td>\n<td>0<\/td>\n<td>\u53f3\u8fb9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5de6\u8fb9\u7ec4&#xff1a;2, 2, 3<\/p>\n<\/li>\n<li>\n<p>\u53f3\u8fb9\u7ec4&#xff1a;1, 1, 5<\/p>\n<\/li>\n<\/ul>\n<p>\u5206\u7ec4\u540e\u6211\u4eec\u53d1\u73b0&#xff1a;<\/p>\n<ul>\n<li>\n<p>3 \u548c 5 \u88ab\u5206\u5230\u4e86\u4e0d\u540c\u7684\u7ec4&#xff01;<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u7ec4\u7684\u5176\u4ed6\u6570\u5b57\u90fd\u662f\u6210\u5bf9\u7684<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>step4. \u5404\u7ec4\u5f02\u6216<\/h3>\n<p>\u5de6\u8fb9\u7ec4&#xff1a;2 ^ 2 ^ 3 &#061; 3<\/p>\n<ul>\n<li>\n<p>2 \u548c 2 \u4e92\u76f8\u62b5\u6d88<\/p>\n<\/li>\n<li>\n<p>\u5269\u4e0b 3 \u2713<\/p>\n<\/li>\n<\/ul>\n<p>\u53f3\u8fb9\u7ec4&#xff1a;1 ^ 1 ^ 5 &#061; 5<\/p>\n<ul>\n<li>\n<p>1 \u548c 1 \u4e92\u76f8\u62b5\u6d88<\/p>\n<\/li>\n<li>\n<p>\u5269\u4e0b 5 \u2713<\/p>\n<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u662f\u8be5\u4f8b\u5b50\u7684\u53ef\u89c6\u5316\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u539f\u59cb\u6570\u7ec4&#xff1a;[1, 2, 1, 3, 2, 5]<br \/>\n            \u2193<br \/>\n\u5168\u90e8\u5f02\u6216&#xff1a;6&#xff08;3^5\u7684\u6df7\u5408\u4f53&#xff09;<br \/>\n            \u2193<br \/>\n\u627e\u6700\u4f4e\u4f4d1&#xff1a;2&#xff08;\u4e8c\u8fdb\u5236010&#xff09;<br \/>\n            \u2193<br \/>\n\u5206\u7ec4&#xff1a;<br \/>\n  \u5de6\u8fb9&#xff08;\u7b2c\u4e8c\u4f4d&#061;1&#xff09;&#xff1a;[2, 3, 2] \u2192 \u5f02\u6216\u5f97\u5230 3<br \/>\n  \u53f3\u8fb9&#xff08;\u7b2c\u4e8c\u4f4d&#061;0&#xff09;&#xff1a;[1, 1, 5] \u2192 \u5f02\u6216\u5f97\u5230 5<br \/>\n            \u2193<br \/>\n\u7b54\u6848&#xff1a;[3, 5] <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u603b\u7ed3\u4e00\u4e0b&#xff1a;\u5148\u628a\u6240\u6709\u6570\u5b57\u5f02\u6216\u5f97\u5230&#034;\u6df7\u5408\u4f53&#034;&#xff0c;\u627e\u5230\u4e24\u4e2a\u5355\u8eab\u72d7\u4e0d\u540c\u7684\u4e00\u4e2a\u4e8c\u8fdb\u5236\u4f4d&#xff0c;\u6309\u8fd9\u4e2a\u4f4d\u5206\u7ec4&#xff0c;\u7136\u540e\u6bcf\u7ec4\u5206\u522b\u5f02\u6216&#xff0c;\u5c31\u5f97\u5230\u4e86\u4e24\u4e2a\u6570\u5b57&#xff01;<\/p>\n<h2>\u8be6\u89e3\u4ee3\u7801<\/h2>\n<p>class Solution {<br \/>\npublic:<br \/>\n    vector&lt;int&gt; singleNumber(vector&lt;int&gt;&amp; nums)<br \/>\n    {<br \/>\n        long long step1&#061;0;<br \/>\n        \/\/step1.\u5168\u90e8\u5f02\u6216<br \/>\n        for(auto it:nums)<br \/>\n        {<br \/>\n            step1^&#061;it;<br \/>\n        }<br \/>\n        \/\/step2 \u627e\u5f02\u6216\u7ed3\u679c\u6700\u4f4e\u4f4d\u76841<br \/>\n        long long step2&#061;step1&amp;(-step1);<br \/>\n        \/\/step3 \u5206\u5bb6\u6cd5<br \/>\n        int result1&#061;0,result2&#061;0;<br \/>\n        \/\/step4 \u5404\u7ec4\u5f02\u6216<br \/>\n        for(auto it:nums)<br \/>\n        {<br \/>\n            if((step2&amp;it)!&#061;0)<br \/>\n            {<br \/>\n                result1^&#061;it;<br \/>\n            }<br \/>\n            else<br \/>\n            {<br \/>\n                result2^&#061;it;<br \/>\n            }<br \/>\n        }<br \/>\n        return {result1,result2};<br \/>\n    }<br \/>\n}; <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5b66\u4f1a\u4e86\u5c31\u7ed9\u535a\u4e3b\u70b9\u4e2a\u8d5e\u5457&#xff1f;(\u272a\u03c9\u272a)<\/p>\n<p>\u2014\u2014\u2014&#xff08;\u5982\u6709\u95ee\u9898&#xff0c;\u6b22\u8fce\u8bc4\u8bba\u533a\u63d0\u95ee&#xff09;\u2014\u2014\u2014<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u94fe\u63a5<br \/>\n260. \u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57 III &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<br \/>\n\u9898\u76ee\u7406\u89e3 \u4e0d\u96be\u7406\u89e3&#xff0c;\u6bd4\u5982[1,2,1,3,2,5]\u4e2d&#xff0c;3\u548c5\u53ea\u51fa\u73b0\u8fc7\u4e00\u6b21&#xff0c;\u56e0\u6b64\u8f93\u51fa3\u548c5\u3002\u4e3b\u8981\u96be\u70b9\u5728\u89e3\u9898\u601d\u8def&#xff0c;\u8fd9\u91cc\u4e0d\u8fc7\u591a\u89e3\u91ca\u3002<br \/>\n\u89e3\u9898\u601d\u8def \u8fd9\u9053\u9898\u548c\u5e73\u65f6\u89c1\u5230\u7684\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57\u4e0d\u540c\u3002\u56e0\u4e3a\u8fd9\u6b21\u6211\u4eec\u6709\u4e24\u4e2a\u6570\u5b57\u4e4b\u51fa\u73b0\u4e86\u4e00\u6b21\u3002\u56e0\u6b64\u6211\u4eec\u4e0d\u80fd\u5c06\u6570\u5b57\u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\u540e\u53d6\u6a21\u3002\u4e0b\u9762\u6211\u4eec\u770b\u4e00\u4e0b\u8fd9\u9053\u9898\u600e\u4e48\u89e3&#xff1a;<br \/>\nstep1.\u5168\u90e8<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[427],"topic":[],"class_list":["post-64211","post","type-post","status-publish","format-standard","hentry","category-server","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III - \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\/64211.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u9898\u76ee\u94fe\u63a5 260. \u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57 III - \u529b\u6263&#xff08;LeetCode&#xff09; \u9898\u76ee\u7406\u89e3 \u4e0d\u96be\u7406\u89e3&#xff0c;\u6bd4\u5982[1,2,1,3,2,5]\u4e2d&#xff0c;3\u548c5\u53ea\u51fa\u73b0\u8fc7\u4e00\u6b21&#xff0c;\u56e0\u6b64\u8f93\u51fa3\u548c5\u3002\u4e3b\u8981\u96be\u70b9\u5728\u89e3\u9898\u601d\u8def&#xff0c;\u8fd9\u91cc\u4e0d\u8fc7\u591a\u89e3\u91ca\u3002 \u89e3\u9898\u601d\u8def \u8fd9\u9053\u9898\u548c\u5e73\u65f6\u89c1\u5230\u7684\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57\u4e0d\u540c\u3002\u56e0\u4e3a\u8fd9\u6b21\u6211\u4eec\u6709\u4e24\u4e2a\u6570\u5b57\u4e4b\u51fa\u73b0\u4e86\u4e00\u6b21\u3002\u56e0\u6b64\u6211\u4eec\u4e0d\u80fd\u5c06\u6570\u5b57\u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\u540e\u53d6\u6a21\u3002\u4e0b\u9762\u6211\u4eec\u770b\u4e00\u4e0b\u8fd9\u9053\u9898\u600e\u4e48\u89e3&#xff1a; step1.\u5168\u90e8\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/64211.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-22T17:04:26+00:00\" \/>\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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64211.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/64211.html\",\"name\":\"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-22T17:04:26+00:00\",\"dateModified\":\"2026-01-22T17:04:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/64211.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/64211.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64211.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III\"}]},{\"@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":"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III - \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\/64211.html","og_locale":"zh_CN","og_type":"article","og_title":"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u9898\u76ee\u94fe\u63a5 260. \u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57 III - \u529b\u6263&#xff08;LeetCode&#xff09; \u9898\u76ee\u7406\u89e3 \u4e0d\u96be\u7406\u89e3&#xff0c;\u6bd4\u5982[1,2,1,3,2,5]\u4e2d&#xff0c;3\u548c5\u53ea\u51fa\u73b0\u8fc7\u4e00\u6b21&#xff0c;\u56e0\u6b64\u8f93\u51fa3\u548c5\u3002\u4e3b\u8981\u96be\u70b9\u5728\u89e3\u9898\u601d\u8def&#xff0c;\u8fd9\u91cc\u4e0d\u8fc7\u591a\u89e3\u91ca\u3002 \u89e3\u9898\u601d\u8def \u8fd9\u9053\u9898\u548c\u5e73\u65f6\u89c1\u5230\u7684\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57\u4e0d\u540c\u3002\u56e0\u4e3a\u8fd9\u6b21\u6211\u4eec\u6709\u4e24\u4e2a\u6570\u5b57\u4e4b\u51fa\u73b0\u4e86\u4e00\u6b21\u3002\u56e0\u6b64\u6211\u4eec\u4e0d\u80fd\u5c06\u6570\u5b57\u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\u540e\u53d6\u6a21\u3002\u4e0b\u9762\u6211\u4eec\u770b\u4e00\u4e0b\u8fd9\u9053\u9898\u600e\u4e48\u89e3&#xff1a; step1.\u5168\u90e8","og_url":"https:\/\/www.wsisp.com\/helps\/64211.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-22T17:04:26+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/64211.html","url":"https:\/\/www.wsisp.com\/helps\/64211.html","name":"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-22T17:04:26+00:00","dateModified":"2026-01-22T17:04:26+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/64211.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/64211.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/64211.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"leetcode260.\u53ea\u51fa\u73b0\u4e00\u6b21\u7684\u6570\u5b57III"}]},{"@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\/64211","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=64211"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64211\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=64211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=64211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=64211"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=64211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}