{"id":60564,"date":"2026-01-15T22:05:26","date_gmt":"2026-01-15T14:05:26","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/60564.html"},"modified":"2026-01-15T22:05:26","modified_gmt":"2026-01-15T14:05:26","slug":"leetcode-85-%e6%9c%80%e5%a4%a7%e7%9f%a9%e5%bd%a2%e3%80%90%e5%9b%b0%e9%9a%be%e3%80%91","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/60564.html","title":{"rendered":"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011"},"content":{"rendered":"<h2>2025\u6bcf\u65e5\u5237\u9898&#xff08;238&#xff09;<\/h2>\n<h3>Leetcode\u201485. \u6700\u5927\u77e9\u5f62<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260115140524-6968f4247a5a3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u7b97\u6cd5\u601d\u60f3<\/h3>\n<h4>\u6808\u600e\u4e48\u7b97 right&#xff1f;<\/h4>\n<p>\u5f53\u4f60\u8d70\u5230 i&#xff0c;\u9ad8\u5ea6\u662f h&#xff1a;<\/p>\n<p>\u5982\u679c h \u6bd4\u6808\u9876\u9ad8\u5ea6\u5c0f&#xff08;\u6216\u76f8\u7b49&#xff09;&#xff0c;\u8bf4\u660e&#xff1a;<\/p>\n<p>\u6808\u9876\u90a3\u4e2a\u67f1\u5b50 top \u53f3\u8fb9\u7b2c\u4e00\u6b21\u9047\u5230\u66f4\u77ee\u7684&#xff0c;\u5c31\u662f\u73b0\u5728\u7684 i<\/p>\n<p>\u6240\u4ee5\u7acb\u523b\u786e\u5b9a&#xff1a;right[top] &#061; i<\/p>\n<p>\u7136\u540e\u5f39\u51fa top&#xff0c;\u4e00\u76f4\u5f39\u5230\u6808\u9876\u6bd4 h \u5c0f\u4e3a\u6b62&#xff08;\u4fdd\u6301\u9012\u589e&#xff09;<\/p>\n<p>\u6240\u4ee5 right[\u2026] \u90fd\u662f\u5728\u201c\u51fa\u6808\u201d\u7684\u90a3\u4e00\u523b\u786e\u5b9a\u7684\u3002<\/p>\n<h4>\u6808\u600e\u4e48\u7b97 left&#xff1f;<\/h4>\n<p>\u5f53\u5f39\u6808\u7ed3\u675f\u540e&#xff1a;<\/p>\n<p>\u5982\u679c\u6808\u4e0d\u7a7a&#xff0c;\u65b0\u7684\u6808\u9876\u5c31\u662f\u5de6\u8fb9\u79bb i \u6700\u8fd1\u4e14\u66f4\u77ee\u7684\u67f1\u5b50\u4e0b\u6807<\/p>\n<p>left[i] &#061; stk[top]<\/p>\n<p>\u5982\u679c\u6808\u7a7a&#xff0c;\u8bf4\u660e\u5de6\u8fb9\u6ca1\u6709\u66f4\u77ee\u7684<\/p>\n<p>left[i] &#061; -1<\/p>\n<p>\u6240\u4ee5 left[i] \u662f\u5728\u201c\u5165\u6808\u524d\u201d\u901a\u8fc7\u6808\u9876\u76f4\u63a5\u5f97\u5230\u7684\u3002<\/p>\n<h3>\u5355\u8c03\u6808\u5b9e\u73b0\u4ee3\u7801<\/h3>\n<p><span class=\"token keyword\">func<\/span> <span class=\"token function\">maximalRectangle<\/span><span class=\"token punctuation\">(<\/span>matrix <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">byte<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token builtin\">int<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    n <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>matrix<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    heights <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">make<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">int<\/span><span class=\"token punctuation\">,<\/span> n<span class=\"token punctuation\">)<\/span><br \/>\n    ans <span class=\"token operator\">:&#061;<\/span> <span class=\"token number\">0<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token boolean\">_<\/span><span class=\"token punctuation\">,<\/span> row <span class=\"token operator\">:&#061;<\/span> <span class=\"token keyword\">range<\/span> matrix <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> j<span class=\"token punctuation\">,<\/span> c <span class=\"token operator\">:&#061;<\/span> <span class=\"token keyword\">range<\/span> row <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">if<\/span><span class=\"token punctuation\">(<\/span>c <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token char\">&#039;1&#039;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                heights<span class=\"token punctuation\">[<\/span>j<span class=\"token punctuation\">]<\/span><span class=\"token operator\">&#043;&#043;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                heights<span class=\"token punctuation\">[<\/span>j<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        ans <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">max<\/span><span class=\"token punctuation\">(<\/span>ans<span class=\"token punctuation\">,<\/span> <span class=\"token function\">largeArea<\/span><span class=\"token punctuation\">(<\/span>heights<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> ans<br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">func<\/span> <span class=\"token function\">largeArea<\/span><span class=\"token punctuation\">(<\/span>height <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">int<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token builtin\">int<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    n <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>height<span class=\"token punctuation\">)<\/span><br \/>\n    stk <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">make<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">int<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    left<span class=\"token punctuation\">,<\/span> right <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">make<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">int<\/span><span class=\"token punctuation\">,<\/span> n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token function\">make<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">int<\/span><span class=\"token punctuation\">,<\/span> n<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> i <span class=\"token operator\">:&#061;<\/span> <span class=\"token keyword\">range<\/span> n <span class=\"token punctuation\">{<\/span><br \/>\n        right<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> n<br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">for<\/span> i<span class=\"token punctuation\">,<\/span> h <span class=\"token operator\">:&#061;<\/span> <span class=\"token keyword\">range<\/span> height <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> <span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span> <span class=\"token operator\">&amp;&amp;<\/span> height<span class=\"token punctuation\">[<\/span>stk<span class=\"token punctuation\">[<\/span><span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&gt;&#061;<\/span> h <span class=\"token punctuation\">{<\/span><br \/>\n            right<span class=\"token punctuation\">[<\/span>stk<span class=\"token punctuation\">[<\/span><span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> i<br \/>\n            stk <span class=\"token operator\">&#061;<\/span> stk<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">:<\/span><span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token keyword\">if<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            left<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> stk<span class=\"token punctuation\">[<\/span><span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            left<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        stk <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">append<\/span><span class=\"token punctuation\">(<\/span>stk<span class=\"token punctuation\">,<\/span> i<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    res <span class=\"token operator\">:&#061;<\/span> <span class=\"token number\">0<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> i <span class=\"token operator\">:&#061;<\/span> <span class=\"token keyword\">range<\/span> n <span class=\"token punctuation\">{<\/span><br \/>\n        res <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">max<\/span><span class=\"token punctuation\">(<\/span>res<span class=\"token punctuation\">,<\/span> height<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">*<\/span> <span class=\"token punctuation\">(<\/span>right<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#8211;<\/span> left<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> res<br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u8fd0\u884c\u7ed3\u679c<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260115140524-6968f424e44a8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><font color=\"#FF5B22\" size=\"3\" face=\"\u6977\u4f53\">\u4e4b\u540e\u6211\u4f1a\u6301\u7eed\u66f4\u65b0&#xff0c;\u5982\u679c\u559c\u6b22\u6211\u7684\u6587\u7ae0&#xff0c;\u8bf7\u8bb0\u5f97\u4e00\u952e\u4e09\u8fde\u54e6&#xff0c;\u70b9\u8d5e\u5173\u6ce8\u6536\u85cf&#xff0c;\u4f60\u7684\u6bcf\u4e00\u4e2a\u8d5e\u6bcf\u4e00\u4efd\u5173\u6ce8\u6bcf\u4e00\u6b21\u6536\u85cf\u90fd\u5c06\u662f\u6211\u524d\u8fdb\u8def\u4e0a\u7684\u65e0\u9650\u52a8\u529b &#xff01;&#xff01;&#xff01;\u2196(\u2594\u25bd\u2594)\u2197\u611f\u8c22\u652f\u6301&#xff01;<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2025\u6bcf\u65e5\u5237\u9898&#xff08;238&#xff09;<br \/>\nLeetcode\u201485. \u6700\u5927\u77e9\u5f62\u7b97\u6cd5\u601d\u60f3<br \/>\n\u6808\u600e\u4e48\u7b97 right&#xff1f;<br \/>\n\u5f53\u4f60\u8d70\u5230 i&#xff0c;\u9ad8\u5ea6\u662f h&#xff1a;<br \/>\n\u5982\u679c h \u6bd4\u6808\u9876\u9ad8\u5ea6\u5c0f&#xff08;\u6216\u76f8\u7b49&#xff09;&#xff0c;\u8bf4\u660e&#xff1a;<br \/>\n\u6808\u9876\u90a3\u4e2a\u67f1\u5b50 top \u53f3\u8fb9\u7b2c\u4e00\u6b21\u9047\u5230\u66f4\u77ee\u7684&#xff0c;\u5c31\u662f\u73b0\u5728\u7684 i<br \/>\n\u6240\u4ee5\u7acb\u523b\u786e\u5b9a&#xff1a;right[top]  i<br \/>\n\u7136\u540e\u5f39\u51fa top&#xff0c;\u4e00\u76f4\u5f39\u5230\u6808\u9876\u6bd4 h \u5c0f\u4e3a\u6b62<\/p>\n","protected":false},"author":2,"featured_media":60562,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[746,2692,4090,427,124,925],"topic":[],"class_list":["post-60564","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-golang","tag-leetcode","tag-4090","tag-427","tag-124","tag-925"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011 - \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\/60564.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"2025\u6bcf\u65e5\u5237\u9898&#xff08;238&#xff09; Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u7b97\u6cd5\u601d\u60f3 \u6808\u600e\u4e48\u7b97 right&#xff1f; \u5f53\u4f60\u8d70\u5230 i&#xff0c;\u9ad8\u5ea6\u662f h&#xff1a; \u5982\u679c h \u6bd4\u6808\u9876\u9ad8\u5ea6\u5c0f&#xff08;\u6216\u76f8\u7b49&#xff09;&#xff0c;\u8bf4\u660e&#xff1a; \u6808\u9876\u90a3\u4e2a\u67f1\u5b50 top \u53f3\u8fb9\u7b2c\u4e00\u6b21\u9047\u5230\u66f4\u77ee\u7684&#xff0c;\u5c31\u662f\u73b0\u5728\u7684 i \u6240\u4ee5\u7acb\u523b\u786e\u5b9a&#xff1a;right[top] i \u7136\u540e\u5f39\u51fa top&#xff0c;\u4e00\u76f4\u5f39\u5230\u6808\u9876\u6bd4 h \u5c0f\u4e3a\u6b62\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/60564.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-15T14:05:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260115140524-6968f4247a5a3.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=\"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\/60564.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/60564.html\",\"name\":\"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-15T14:05:26+00:00\",\"dateModified\":\"2026-01-15T14:05:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/60564.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/60564.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60564.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011\"}]},{\"@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\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011 - \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\/60564.html","og_locale":"zh_CN","og_type":"article","og_title":"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"2025\u6bcf\u65e5\u5237\u9898&#xff08;238&#xff09; Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u7b97\u6cd5\u601d\u60f3 \u6808\u600e\u4e48\u7b97 right&#xff1f; \u5f53\u4f60\u8d70\u5230 i&#xff0c;\u9ad8\u5ea6\u662f h&#xff1a; \u5982\u679c h \u6bd4\u6808\u9876\u9ad8\u5ea6\u5c0f&#xff08;\u6216\u76f8\u7b49&#xff09;&#xff0c;\u8bf4\u660e&#xff1a; \u6808\u9876\u90a3\u4e2a\u67f1\u5b50 top \u53f3\u8fb9\u7b2c\u4e00\u6b21\u9047\u5230\u66f4\u77ee\u7684&#xff0c;\u5c31\u662f\u73b0\u5728\u7684 i \u6240\u4ee5\u7acb\u523b\u786e\u5b9a&#xff1a;right[top] i \u7136\u540e\u5f39\u51fa top&#xff0c;\u4e00\u76f4\u5f39\u5230\u6808\u9876\u6bd4 h \u5c0f\u4e3a\u6b62","og_url":"https:\/\/www.wsisp.com\/helps\/60564.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-15T14:05:26+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260115140524-6968f4247a5a3.png"}],"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\/60564.html","url":"https:\/\/www.wsisp.com\/helps\/60564.html","name":"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-15T14:05:26+00:00","dateModified":"2026-01-15T14:05:26+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/60564.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/60564.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/60564.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Leetcode\u201485. \u6700\u5927\u77e9\u5f62\u3010\u56f0\u96be\u3011"}]},{"@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\/60564","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=60564"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60564\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/60562"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=60564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=60564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=60564"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=60564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}