{"id":72662,"date":"2026-02-06T11:17:32","date_gmt":"2026-02-06T03:17:32","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/72662.html"},"modified":"2026-02-06T11:17:32","modified_gmt":"2026-02-06T03:17:32","slug":"day24-%e4%bb%a3%e7%a0%81%e9%9a%8f%e6%83%b3%e5%bd%95%e7%ae%97%e6%b3%95%e8%ae%ad%e7%bb%83%e8%90%a5-%e5%9b%9e%e6%ba%af%e4%b8%93%e9%a2%983","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/72662.html","title":{"rendered":"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983"},"content":{"rendered":"<h2>1 \u4eca\u65e5\u6253\u5361<\/h2>\n<p>\u590d\u539fIP\u5730\u5740\u00a093. \u590d\u539f IP \u5730\u5740 &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<\/p>\n<p>\u5b50\u96c6\u00a078. \u5b50\u96c6 &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<\/p>\n<p>\u5b50\u96c6\u2161\u00a090. \u5b50\u96c6 II &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<\/p>\n<\/p>\n<h2>2 \u590d\u539fIP\u5730\u5740<\/h2>\n<h3 style=\"background-color:transparent\">2.1 \u601d\u8def<\/h3>\n<p>startIndex&#xff1a;\u5b57\u7b26\u4e32\u5f53\u524d\u5206\u5272\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u907f\u514d\u91cd\u590d\u5206\u5272\u5b57\u7b26&#xff09; pointNum&#xff1a;\u5df2\u6dfb\u52a0\u7684\u70b9\u7684\u6570\u91cf&#xff08;\u70b9\u7684\u6570\u91cf\u4e3a 3 \u65f6&#xff0c;\u8bf4\u660e\u5df2\u5206\u6210 4 \u6bb5&#xff0c;\u89e6\u53d1\u7ec8\u6b62\u6761\u4ef6&#xff09; \u7ec8\u6b62\u6761\u4ef6&#xff1a;\u70b9\u7684\u6570\u91cfpointNum &#061;&#061; 3&#xff0c;\u6b64\u65f6\u53ea\u9700\u9a8c\u8bc1\u6700\u540e\u4e00\u6bb5\u662f\u5426\u5408\u6cd5&#xff0c;\u5408\u6cd5\u5219\u62fc\u63a5\u6210 IP \u5730\u5740\u52a0\u5165\u7ed3\u679c\u96c6 \u5355\u5c42\u9012\u5f52\u903b\u8f91&#xff1a;\u4ecestartIndex\u5f00\u59cb&#xff0c;\u904d\u5386\u5b57\u7b26\u4e32\u5c1d\u8bd5\u5206\u5272\u51fa1~3 \u4f4d\u7684\u5b50\u4e32&#xff08;IP \u6bb5\u6700\u591a 3 \u4f4d&#xff09;&#xff0c;\u9a8c\u8bc1\u5b50\u4e32\u5408\u6cd5\u540e&#xff0c;\u5c06\u5176\u52a0\u5165\u4e34\u65f6\u8def\u5f84&#xff0c;\u9012\u5f52\u5904\u7406\u4e0b\u4e00\u6bb5&#xff0c;\u9012\u5f52\u7ed3\u675f\u540e\u56de\u6eaf\u91cd\u7f6e\u72b6\u6001&#xff08;\u79fb\u9664\u4e34\u65f6\u8def\u5f84\u7684\u6700\u540e\u4e00\u6bb5\u3001\u70b9\u7684\u6570\u91cf\u51cf 1&#xff09; \u5408\u6cd5\u6027\u6821\u9a8c&#xff1a;\u5355\u72ec\u5c01\u88c5isValid\u65b9\u6cd5&#xff0c;\u5224\u65ad\u5206\u5272\u51fa\u7684\u5b50\u4e32\u662f\u5426\u4e3a\u6709\u6548 IP \u6bb5<\/p>\n<p>\u7528 List&lt;String&gt;\u5b58\u50a8\u8def\u5f84&#xff0c;\u800c\u4e0d\u662f StringBuilder&#xff0c;\u5426\u5219\u4f1a\u5f88\u590d\u6742\u3002<\/p>\n<p>\u5728\u5408\u6cd5\u6027\u6821\u9a8c\u4e2d&#xff0c;\u9700\u8981\u52a0start &gt; end\u8fd4\u56deflase\u7684\u5224\u65ad&#xff0c;\u5426\u5219\u4f1a\u51fa\u73b0\u7a7a\u6307\u9488\u5f02\u5e38\u3002\u56e0\u4e3a\u5982\u679c\u524d\u9762\u4e09\u6bb5\u628a\u5b57\u7b26\u4e32\u5206\u5272\u5b8c\u4e86&#xff0c;\u518d\u8fdb\u5165\u4e0b\u4e00\u5c42\u9012\u5f52\u7684\u65f6\u5019&#xff0c;start\u7684\u503c\u4f1a\u6bd4end\u8fd8\u5927&#xff0c;\u8fd9\u4e2a\u65f6\u5019s.charAt(start)\u5c31\u4f1a\u6709\u7a7a\u6307\u9488\u5f02\u5e38\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"675\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260206031729-69855d49ebd3b.png\" width=\"1446\" \/><\/p>\n<h3>2.2 \u5b9e\u73b0\u4ee3\u7801<\/h3>\n<p>class Solution {<br \/>\n    \/\/ \u7ed3\u679c\u96c6&#xff1a;\u5b58\u50a8\u6240\u6709\u5408\u6cd5\u7684IP\u5730\u5740<br \/>\n    List&lt;String&gt; res &#061; new ArrayList&lt;&gt;();<br \/>\n    \/\/ \u8def\u5f84\u96c6&#xff1a;\u5b58\u50a8\u56de\u6eaf\u8fc7\u7a0b\u4e2d\u5206\u5272\u51fa\u7684\u5408\u6cd5IP\u6bb5&#xff08;\u6700\u591a3\u6bb5&#xff0c;\u56e0\u4e3apointNum&#061;3\u65f6\u5904\u7406\u6700\u540e\u4e00\u6bb5&#xff09;<br \/>\n    List&lt;String&gt; path &#061; new ArrayList&lt;&gt;();<\/p>\n<p>    \/**<br \/>\n     * \u4e3b\u65b9\u6cd5&#xff1a;\u5165\u53e3&#xff0c;\u521d\u59cb\u5316\u5e76\u8c03\u7528\u56de\u6eaf\u65b9\u6cd5<br \/>\n     * &#064;param s \u8f93\u5165\u7684\u6570\u5b57\u5b57\u7b26\u4e32<br \/>\n     * &#064;return \u6240\u6709\u5408\u6cd5\u7684IP\u5730\u5740\u5217\u8868<br \/>\n     *\/<br \/>\n    public List&lt;String&gt; restoreIpAddresses(String s) {<br \/>\n        \/\/ \u524d\u7f6e\u526a\u679d&#xff1a;IP\u5730\u5740\u603b\u957f\u5ea6\u6700\u5c0f4\u4f4d&#xff08;0.0.0.0&#xff09;&#xff0c;\u6700\u592712\u4f4d&#xff08;255.255.255.255&#xff09;&#xff0c;\u4e0d\u7b26\u5408\u76f4\u63a5\u8fd4\u56de\u7a7a<br \/>\n        if (s.length() &lt; 4 || s.length() &gt; 12) return res;<br \/>\n        \/\/ \u8c03\u7528\u56de\u6eaf\u65b9\u6cd5&#xff0c;\u521d\u59cb&#xff1a;\u5206\u5272\u8d77\u59cb\u7d22\u5f150&#xff0c;\u5df2\u6dfb\u52a0\u70b9\u6570\u91cf0<br \/>\n        backtracking(s, 0, 0);<br \/>\n        return res;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u56de\u6eaf\u6838\u5fc3\u65b9\u6cd5<br \/>\n     * &#064;param s \u8f93\u5165\u7684\u6570\u5b57\u5b57\u7b26\u4e32<br \/>\n     * &#064;param startIndex \u5f53\u524d\u5206\u5272\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u907f\u514d\u91cd\u590d\u5206\u5272&#xff09;<br \/>\n     * &#064;param pointNum \u5df2\u6dfb\u52a0\u7684\u70b9\u7684\u6570\u91cf&#xff08;\u70b9\u6570\u91cf&#061;3\u65f6&#xff0c;\u5206\u62104\u6bb5&#xff0c;\u89e6\u53d1\u7ec8\u6b62&#xff09;<br \/>\n     *\/<br \/>\n    public void backtracking(String s, int startIndex, int pointNum) {<br \/>\n        \/\/ \u7ec8\u6b62\u6761\u4ef6&#xff1a;\u5df2\u6dfb\u52a03\u4e2a\u70b9&#xff0c;\u8bf4\u660e\u5b57\u7b26\u4e32\u5df2\u88ab\u5206\u6210\u524d3\u6bb5&#xff0c;\u53ea\u9700\u5904\u7406\u6700\u540e\u4e00\u6bb5<br \/>\n        if(pointNum &#061;&#061; 3) {<br \/>\n            \/\/ \u9a8c\u8bc1\u6700\u540e\u4e00\u6bb5\u662f\u5426\u5408\u6cd5&#xff1a;\u8d77\u59cb\u7d22\u5f15startIndex \u5230 \u5b57\u7b26\u4e32\u672b\u5c3e<br \/>\n            if(isValid(s, startIndex, s.length() &#8211; 1)) {<br \/>\n                \/\/ \u62fc\u63a5\u5408\u6cd5IP&#xff1a;\u8def\u5f84\u96c6\u76843\u6bb5 &#043; \u6700\u540e\u4e00\u6bb5&#xff0c;\u7528\u70b9\u5206\u9694<br \/>\n                String ip &#061; path.get(0) &#043; &#034;.&#034; &#043; path.get(1) &#043; &#034;.&#034; &#043; path.get(2) &#043; &#034;.&#034; &#043; s.substring(startIndex, s.length());<br \/>\n                res.add(ip); \/\/ \u52a0\u5165\u7ed3\u679c\u96c6<br \/>\n            }<br \/>\n            return; \/\/ \u7ec8\u6b62\u9012\u5f52&#xff0c;\u8fd4\u56de\u4e0a\u4e00\u5c42<br \/>\n        }<\/p>\n<p>        \/\/ \u5355\u5c42\u9012\u5f52&#xff1a;\u904d\u5386\u5b57\u7b26\u4e32&#xff0c;\u5c1d\u8bd5\u5206\u52721~3\u4f4d\u7684\u5b50\u4e32&#xff08;i &lt; startIndex &#043; 3 \u9650\u5236\u6700\u591a3\u4f4d&#xff09;<br \/>\n        for(int i &#061; startIndex; i &lt; s.length() &amp;&amp; i &lt; startIndex &#043; 3; i&#043;&#043;) {<br \/>\n            \/\/ \u9a8c\u8bc1\u5f53\u524d\u5206\u5272\u7684\u5b50\u4e32[startIndex, i]\u662f\u5426\u4e3a\u6709\u6548IP\u6bb5<br \/>\n            if(isValid(s, startIndex, i)) {<br \/>\n                \/\/ \u5408\u6cd5\u5219\u52a0\u5165\u8def\u5f84\u96c6&#xff1a;\u622a\u53d6[startIndex, i]\u7684\u5b50\u4e32<br \/>\n                path.add(s.substring(startIndex, i &#043; 1));<br \/>\n                pointNum&#043;&#043;; \/\/ \u70b9\u7684\u6570\u91cf&#043;1<br \/>\n                \/\/ \u9012\u5f52\u5904\u7406\u4e0b\u4e00\u6bb5&#xff1a;\u4e0b\u4e00\u6bb5\u8d77\u59cb\u7d22\u5f15\u4e3ai&#043;1&#xff0c;\u70b9\u6570\u91cf&#043;1<br \/>\n                backtracking(s, i &#043; 1, pointNum);<br \/>\n                \/\/ \u56de\u6eaf&#xff1a;\u91cd\u7f6e\u72b6\u6001&#xff0c;\u6062\u590d\u5230\u9012\u5f52\u524d\u7684\u6837\u5b50&#xff08;\u6838\u5fc3&#xff01;&#xff09;<br \/>\n                pointNum&#8211;; \/\/ \u70b9\u7684\u6570\u91cf\u51cf1<br \/>\n                path.remove(path.size() &#8211; 1); \/\/ \u79fb\u9664\u8def\u5f84\u96c6\u6700\u540e\u4e00\u4e2a\u6dfb\u52a0\u7684IP\u6bb5<br \/>\n            }<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u6821\u9a8c\u65b9\u6cd5&#xff1a;\u5224\u65ad\u5b57\u7b26\u4e32s\u4e2d[start, end]\u533a\u95f4\u7684\u5b50\u4e32\u662f\u5426\u4e3a\u6709\u6548IP\u6bb5<br \/>\n     * &#064;param s \u8f93\u5165\u7684\u6570\u5b57\u5b57\u7b26\u4e32<br \/>\n     * &#064;param start \u5b50\u4e32\u8d77\u59cb\u7d22\u5f15<br \/>\n     * &#064;param end \u5b50\u4e32\u7ed3\u675f\u7d22\u5f15<br \/>\n     * &#064;return \u6709\u6548\u8fd4\u56detrue&#xff0c;\u65e0\u6548\u8fd4\u56defalse<br \/>\n     *\/<br \/>\n    public boolean isValid(String s, int start, int end) {<br \/>\n        \/\/ \u8fb9\u754c\u5224\u65ad&#xff1a;\u8d77\u59cb\u7d22\u5f15\u5927\u4e8e\u7ed3\u675f\u7d22\u5f15&#xff0c;\u7a7a\u6bb5&#xff0c;\u76f4\u63a5\u65e0\u6548<br \/>\n        if(start &gt; end) return false;<br \/>\n        \/\/ \u957f\u5ea6\u5224\u65ad&#xff1a;IP\u6bb5\u6700\u591a3\u4f4d&#xff0c;\u8d85\u8fc7\u5219\u65e0\u6548&#xff08;\u5faa\u73af\u5df2\u9650\u5236&#xff0c;\u6b64\u5904\u505a\u53cc\u91cd\u6821\u9a8c&#xff09;<br \/>\n        if(end &#8211; start &gt;&#061; 3) return false;<br \/>\n        \/\/ \u524d\u5bfc0\u5224\u65ad&#xff1a;\u4ee50\u5f00\u5934\u4e14\u957f\u5ea6\u5927\u4e8e1&#xff0c;\u65e0\u6548&#xff08;\u598201\u3001012&#xff0c;\u5355\u72ec0\u5408\u6cd5&#xff09;<br \/>\n        if(s.charAt(start) &#061;&#061; &#039;0&#039; &amp;&amp; start !&#061; end) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        \/\/ \u6570\u5b57\u5224\u65ad&#xff1a;\u904d\u5386\u5b50\u4e32&#xff0c;\u786e\u4fdd\u6bcf\u4e00\u4f4d\u90fd\u662f\u6570\u5b57&#xff08;\u907f\u514d\u975e\u6570\u5b57\u5b57\u7b26&#xff0c;\u9898\u76ee\u867d\u7ed9\u6570\u5b57\u4e32&#xff0c;\u6b64\u5904\u505a\u9632\u5fa1\u6027\u6821\u9a8c&#xff09;<br \/>\n        int index &#061; start;<br \/>\n        while(index &lt;&#061; end) {<br \/>\n            \/\/ \u975e0-9\u7684\u5b57\u7b26&#xff0c;\u65e0\u6548<br \/>\n            if(s.charAt(index) &gt; &#039;9&#039; || s.charAt(index) &lt; &#039;0&#039;) {<br \/>\n                return false;<br \/>\n            }<br \/>\n            index&#043;&#043;;<br \/>\n        }<br \/>\n        \/\/ \u6570\u503c\u5224\u65ad&#xff1a;\u622a\u53d6\u5b50\u4e32\u8f6c\u6574\u6570&#xff0c;\u5224\u65ad\u662f\u5426&lt;&#061;255<br \/>\n        String substr &#061; s.substring(start, end &#043; 1);<br \/>\n        if(Integer.parseInt(substr) &gt; 255) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        \/\/ \u6240\u6709\u6821\u9a8c\u901a\u8fc7&#xff0c;\u662f\u6709\u6548IP\u6bb5<br \/>\n        return true;<br \/>\n    }<br \/>\n} <\/p>\n<h2>3 \u5b50\u96c6<\/h2>\n<h3 style=\"background-color:transparent\">3.1 \u601d\u8def<\/h3>\n<p>\u5b50\u96c6\u7684\u672c\u8d28\u662f\u4ece\u6570\u7ec4\u4e2d\u9009\u62e9\u4efb\u610f\u6570\u91cf\u7684\u5143\u7d20&#xff08;\u5305\u62ec 0 \u4e2a&#xff09;&#xff0c;\u4e0d\u8003\u8651\u987a\u5e8f\u4e14\u4e0d\u91cd\u590d\u9009\u62e9&#xff0c;\u56de\u6eaf\u6cd5\u901a\u8fc7\u63a7\u5236\u8d77\u59cb\u7d22\u5f15\u907f\u514d\u91cd\u590d\u9009\u62e9&#xff0c;\u901a\u8fc7\u8fdb\u5165\u9012\u5f52\u65f6\u7acb\u5373\u6536\u96c6\u7ed3\u679c\u5b9e\u73b0\u300c\u6240\u6709\u8282\u70b9\u90fd\u52a0\u5165\u89e3\u96c6\u300d&#xff0c;\u6574\u4f53\u601d\u8def\u662f\u6784\u5efa\u4e00\u68f5\u5b50\u96c6\u6811&#xff0c;\u904d\u5386\u6811\u7684\u6240\u6709\u8282\u70b9\u5e76\u6536\u96c6\u3002 \u56de\u6eaf\u6cd5\u6838\u5fc3\u8981\u7d20&#xff08;\u5b50\u96c6\u95ee\u9898\u4e13\u5c5e&#xff09; 1. \u72b6\u6001\u53d8\u91cf \u4ec5\u9700 **startIndex&#xff1a;\u5f53\u524d\u9009\u62e9\u5143\u7d20\u7684\u8d77\u59cb\u7d22\u5f15&#xff0c;\u7528\u4e8e\u63a7\u5236\u5143\u7d20\u9009\u62e9\u7684\u8303\u56f4 **&#xff0c;\u907f\u514d\u91cd\u590d\u9009\u62e9&#xff08;\u5982\u9009\u4e86 1 \u4e4b\u540e\u53ea\u80fd\u9009 1 \u540e\u9762\u7684\u5143\u7d20&#xff0c;\u9632\u6b62\u51fa\u73b0 [1,2] \u548c [2,1] \u8fd9\u79cd\u91cd\u590d\u5b50\u96c6&#xff09;\u3002 2. \u7ed3\u679c\u6536\u96c6\u65f6\u673a&#xff08;\u6700\u6838\u5fc3\u7684\u533a\u522b&#xff09; \u8fdb\u5165\u9012\u5f52\u65b9\u6cd5\u540e&#xff0c;\u7acb\u5373\u5c06\u5f53\u524d\u8def\u5f84\u52a0\u5165\u7ed3\u679c\u96c6\u2014\u2014 \u56e0\u4e3a\u5b50\u96c6\u6811\u7684\u6bcf\u4e00\u4e2a\u8282\u70b9&#xff08;\u5305\u62ec\u7a7a\u8282\u70b9\u3001\u4e2d\u95f4\u8282\u70b9\u3001\u53f6\u5b50\u8282\u70b9&#xff09;\u90fd\u662f\u4e00\u4e2a\u5408\u6cd5\u5b50\u96c6&#xff0c;\u8fd9\u662f\u5b50\u96c6\u95ee\u9898\u4e0e\u5176\u4ed6\u56de\u6eaf\u95ee\u9898\u7684\u5173\u952e\u5dee\u5f02\u3002 3. \u7ec8\u6b62\u6761\u4ef6&#xff08;\u53ef\u7701\u7565&#xff0c;\u505a\u9632\u5fa1\u6027\u5224\u65ad&#xff09; \u5f53startIndex &gt;&#061; nums.length\u65f6&#xff0c;\u8bf4\u660e\u6570\u7ec4\u5df2\u904d\u5386\u5b8c\u6bd5&#xff0c;\u65e0\u5143\u7d20\u53ef\u518d\u9009\u62e9&#xff0c;\u76f4\u63a5\u8fd4\u56de\u5373\u53ef\u3002 4. \u5355\u5c42\u9012\u5f52\u903b\u8f91 \u4ecestartIndex\u5f00\u59cb\u904d\u5386\u6570\u7ec4&#xff0c;\u5c06\u5f53\u524d\u5143\u7d20\u52a0\u5165\u8def\u5f84\u2192\u9012\u5f52\u9009\u62e9\u4e0b\u4e00\u4e2a\u5143\u7d20&#xff08;\u8d77\u59cb\u7d22\u5f15i&#043;1&#xff09;\u2192\u9012\u5f52\u7ed3\u675f\u540e\u56de\u6eaf\u91cd\u7f6e\u72b6\u6001&#xff08;\u79fb\u9664\u8def\u5f84\u6700\u540e\u4e00\u4e2a\u5143\u7d20&#xff09;&#xff0c;\u5c1d\u8bd5\u4e0b\u4e00\u4e2a\u5143\u7d20\u7684\u9009\u62e9\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"918\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260206031730-69855d4a9a88a.png\" width=\"1476\" \/><\/p>\n<h3>3.2 \u5b9e\u73b0\u4ee3\u7801<\/h3>\n<p>class Solution {<br \/>\n    \/\/ \u7ed3\u679c\u96c6&#xff1a;\u5b58\u50a8\u6240\u6709\u5408\u6cd5\u7684\u5b50\u96c6&#xff0c;\u6bcf\u4e2a\u5b50\u96c6\u662f\u4e00\u4e2aList&lt;Integer&gt;<br \/>\n    List&lt;List&lt;Integer&gt;&gt; res &#061; new ArrayList&lt;&gt;();<br \/>\n    \/\/ \u8def\u5f84\u96c6&#xff1a;\u5b58\u50a8\u56de\u6eaf\u8fc7\u7a0b\u4e2d\u5f53\u524d\u9009\u62e9\u7684\u5143\u7d20\u7ec4\u5408&#xff08;\u5373\u5f53\u524d\u5b50\u96c6&#xff09;<br \/>\n    List&lt;Integer&gt; path &#061; new ArrayList&lt;&gt;();<\/p>\n<p>    \/**<br \/>\n     * \u4e3b\u65b9\u6cd5&#xff1a;\u5165\u53e3&#xff0c;\u521d\u59cb\u5316\u5e76\u8c03\u7528\u56de\u6eaf\u65b9\u6cd5\u6c42\u89e3\u5b50\u96c6<br \/>\n     * &#064;param nums \u8f93\u5165\u7684\u65e0\u91cd\u590d\u6574\u6570\u6570\u7ec4<br \/>\n     * &#064;return \u6570\u7ec4\u7684\u6240\u6709\u5b50\u96c6<br \/>\n     *\/<br \/>\n    public List&lt;List&lt;Integer&gt;&gt; subsets(int[] nums) {<br \/>\n        \/\/ \u8c03\u7528\u56de\u6eaf\u65b9\u6cd5&#xff0c;\u521d\u59cb\u8d77\u59cb\u7d22\u5f15\u4e3a0&#xff08;\u4ece\u6570\u7ec4\u7b2c\u4e00\u4e2a\u5143\u7d20\u5f00\u59cb\u9009\u62e9&#xff09;<br \/>\n        backtracking(nums, 0);<br \/>\n        return res;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u56de\u6eaf\u6838\u5fc3\u65b9\u6cd5&#xff1a;\u6784\u5efa\u5b50\u96c6\u6811&#xff0c;\u6536\u96c6\u6240\u6709\u8282\u70b9\u7684\u8def\u5f84&#xff08;\u5b50\u96c6&#xff09;<br \/>\n     * &#064;param nums \u8f93\u5165\u7684\u65e0\u91cd\u590d\u6574\u6570\u6570\u7ec4<br \/>\n     * &#064;param startIndex \u5f53\u524d\u9009\u62e9\u5143\u7d20\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u63a7\u5236\u9009\u62e9\u8303\u56f4&#xff0c;\u907f\u514d\u91cd\u590d&#xff09;<br \/>\n     *\/<br \/>\n    public void backtracking(int[] nums, int startIndex) {<br \/>\n        \/\/ \u6838\u5fc3\u6b65\u9aa4&#xff1a;\u8fdb\u5165\u9012\u5f52\u7acb\u5373\u6536\u96c6\u5f53\u524d\u8def\u5f84 \u2192 \u5b50\u96c6\u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u90fd\u662f\u5408\u6cd5\u5b50\u96c6<br \/>\n        \/\/ \u6ce8\u610f&#xff1a;\u5fc5\u987bnew ArrayList&lt;&gt;(path)&#xff0c;\u5426\u5219\u6240\u6709res\u5143\u7d20\u90fd\u6307\u5411\u540c\u4e00\u4e2apath\u5bf9\u8c61&#xff0c;\u6700\u7ec8\u7ed3\u679c\u4f1a\u88ab\u8986\u76d6<br \/>\n        res.add(new ArrayList&lt;&gt;(path));<\/p>\n<p>        \/\/ \u7ec8\u6b62\u6761\u4ef6&#xff1a;\u8d77\u59cb\u7d22\u5f15\u8d85\u51fa\u6570\u7ec4\u957f\u5ea6&#xff0c;\u65e0\u5143\u7d20\u53ef\u518d\u9009\u62e9&#xff0c;\u76f4\u63a5\u8fd4\u56de<br \/>\n        \/\/ \u6ce8&#xff1a;\u6b64\u7ec8\u6b62\u6761\u4ef6\u53ef\u7701\u7565&#xff0c;\u56e0\u4e3afor\u5faa\u73af\u4f1a\u56e0i &lt; nums.length\u81ea\u52a8\u7ec8\u6b62&#xff0c;\u6b64\u5904\u505a\u9632\u5fa1\u6027\u5224\u65ad\u66f4\u5065\u58ee<br \/>\n        if (startIndex &gt;&#061; nums.length) {<br \/>\n            return;<br \/>\n        }<\/p>\n<p>        \/\/ \u5355\u5c42\u9012\u5f52\u903b\u8f91&#xff1a;\u4ecestartIndex\u5f00\u59cb\u904d\u5386&#xff0c;\u9009\u62e9\u5f53\u524d\u5143\u7d20\u5e76\u9012\u5f52<br \/>\n        for (int i &#061; startIndex; i &lt; nums.length; i&#043;&#043;) {<br \/>\n            path.add(nums[i]); \/\/ \u9009\u62e9\u5f53\u524d\u5143\u7d20nums[i]&#xff0c;\u52a0\u5165\u8def\u5f84\u96c6<br \/>\n            backtracking(nums, i &#043; 1); \/\/ \u9012\u5f52&#xff1a;\u9009\u62e9\u4e0b\u4e00\u4e2a\u5143\u7d20&#xff0c;\u8d77\u59cb\u7d22\u5f15\u4e3ai&#043;1&#xff08;\u907f\u514d\u91cd\u590d\u9009\u62e9&#xff09;<br \/>\n            path.remove(path.size() &#8211; 1); \/\/ \u56de\u6eaf&#xff1a;\u79fb\u9664\u8def\u5f84\u96c6\u6700\u540e\u4e00\u4e2a\u5143\u7d20&#xff0c;\u6062\u590d\u5230\u9012\u5f52\u524d\u7684\u72b6\u6001<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<h2>4 \u5b50\u96c6\u2161<\/h2>\n<h3 style=\"background-color:transparent\">4.1 \u601d\u8def<\/h3>\n<p>\u6570\u7ec4\u6392\u5e8f&#xff1a;\u5148\u5bf9nums\u8fdb\u884c\u5347\u5e8f\u6392\u5e8f&#xff0c;\u8ba9\u76f8\u540c\u5143\u7d20\u76f8\u90bb\u2014\u2014 \u8fd9\u662f\u53bb\u91cd\u7684\u524d\u63d0&#xff0c;\u53ea\u6709\u76f8\u540c\u5143\u7d20\u6328\u5728\u4e00\u8d77&#xff0c;\u624d\u80fd\u65b9\u4fbf\u5730\u5224\u65ad\u5e76\u8df3\u8fc7\u91cd\u590d\u5143\u7d20&#xff1b; \u56de\u6eaf\u6784\u5efa\u5b50\u96c6&#xff1a;\u6cbf\u7528\u666e\u901a\u5b50\u96c6\u7684\u56de\u6eaf\u903b\u8f91&#xff08;\u8fdb\u5165\u9012\u5f52\u7acb\u5373\u6536\u96c6\u7ed3\u679c\u3001\u63a7\u5236startIndex\u907f\u514d\u91cd\u590d\u9009\u62e9&#xff09;&#xff1b; \u540c\u5c42\u53bb\u91cd&#xff1a;\u5728\u5355\u5c42\u9012\u5f52\u7684\u5faa\u73af\u4e2d&#xff0c;\u5224\u65ad\u5f53\u524d\u5143\u7d20\u662f\u5426\u4e0e\u524d\u4e00\u4e2a\u5143\u7d20\u76f8\u540c&#xff0c;\u4e14\u524d\u4e00\u4e2a\u5143\u7d20\u672a\u88ab\u9009\u62e9&#xff08;\u540c\u5c42&#xff09;&#xff0c;\u82e5\u662f\u5219\u8df3\u8fc7\u8be5\u5143\u7d20&#xff0c;\u907f\u514d\u540c\u5c42\u9009\u62e9\u91cd\u590d\u5143\u7d20\u5bfc\u81f4\u5b50\u96c6\u91cd\u590d\u3002<\/p>\n<p>\u72b6\u6001\u53d8\u91cf&#xff1a;\u4ec5\u9700startIndex&#xff08;\u5f53\u524d\u9009\u62e9\u5143\u7d20\u7684\u8d77\u59cb\u7d22\u5f15&#xff0c;\u63a7\u5236\u9009\u62e9\u8303\u56f4&#xff0c;\u907f\u514d\u8de8\u5c42\u91cd\u590d\u9009\u62e9&#xff09;&#xff1b; \u7ed3\u679c\u6536\u96c6\u65f6\u673a&#xff1a;\u8fdb\u5165\u9012\u5f52\u7acb\u5373\u6536\u96c6\u5f53\u524d\u8def\u5f84&#xff08;\u5b50\u96c6\u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u90fd\u662f\u5408\u6cd5\u5b50\u96c6&#xff0c;\u4e0e\u666e\u901a\u5b50\u96c6\u4e00\u81f4&#xff09;&#xff1b; \u7ec8\u6b62\u6761\u4ef6&#xff1a;startIndex &gt;&#061; nums.length&#xff0c;\u65e0\u5143\u7d20\u53ef\u9009\u62e9\u65f6\u76f4\u63a5\u8fd4\u56de&#xff08;\u9632\u5fa1\u6027\u5224\u65ad&#xff0c;\u53ef\u7701\u7565&#xff09;&#xff1b; \u5355\u5c42\u9012\u5f52\u903b\u8f91&#xff1a;\u4ecestartIndex\u904d\u5386\u6570\u7ec4\u2192\u8df3\u8fc7\u540c\u5c42\u91cd\u590d\u5143\u7d20\u2192\u9009\u62e9\u5f53\u524d\u5143\u7d20\u2192\u9012\u5f52\u2192\u56de\u6eaf\u91cd\u7f6e\u72b6\u6001&#xff1b; \u53bb\u91cd\u5173\u952e&#xff1a;if (i &gt; startIndex &amp;&amp; nums[i] &#061;&#061; nums[i-1]) continue;\u2014\u2014 \u8fd9\u884c\u4ee3\u7801\u662f\u672c\u9898\u7684\u7075\u9b42&#xff0c;\u4e13\u95e8\u62e6\u622a\u540c\u5c42\u91cd\u590d\u5143\u7d20\u3002<\/p>\n<h3>4.2 \u5b9e\u73b0\u4ee3\u7801<\/h3>\n<p>class Solution {<br \/>\n    \/\/ \u7ed3\u679c\u96c6&#xff1a;\u5b58\u50a8\u6240\u6709\u4e0d\u91cd\u590d\u7684\u5b50\u96c6&#xff0c;\u6bcf\u4e2a\u5b50\u96c6\u662f\u4e00\u4e2aList&lt;Integer&gt;<br \/>\n    List&lt;List&lt;Integer&gt;&gt; res &#061; new ArrayList&lt;&gt;();<br \/>\n    \/\/ \u8def\u5f84\u96c6&#xff1a;\u5b58\u50a8\u56de\u6eaf\u8fc7\u7a0b\u4e2d\u5f53\u524d\u9009\u62e9\u7684\u5143\u7d20\u7ec4\u5408&#xff08;\u5f53\u524d\u5b50\u96c6&#xff09;<br \/>\n    List&lt;Integer&gt; path &#061; new ArrayList&lt;&gt;();<\/p>\n<p>    \/**<br \/>\n     * \u4e3b\u65b9\u6cd5&#xff1a;\u5165\u53e3&#xff0c;\u6392\u5e8f\u6570\u7ec4&#043;\u8c03\u7528\u56de\u6eaf\u65b9\u6cd5\u6c42\u89e3\u4e0d\u91cd\u590d\u5b50\u96c6<br \/>\n     * &#064;param nums \u8f93\u5165\u7684\u53ef\u80fd\u5305\u542b\u91cd\u590d\u5143\u7d20\u7684\u6574\u6570\u6570\u7ec4<br \/>\n     * &#064;return \u6570\u7ec4\u7684\u6240\u6709\u4e0d\u91cd\u590d\u5b50\u96c6<br \/>\n     *\/<br \/>\n    public List&lt;List&lt;Integer&gt;&gt; subsetsWithDup(int[] nums) {<br \/>\n        \/\/ \u6838\u5fc3\u6b65\u9aa41&#xff1a;\u6570\u7ec4\u6392\u5e8f&#xff0c;\u8ba9\u76f8\u540c\u5143\u7d20\u76f8\u90bb \u2192 \u4e3a\u540e\u7eed\u540c\u5c42\u53bb\u91cd\u505a\u51c6\u5907&#xff08;\u53bb\u91cd\u7684\u524d\u63d0&#xff09;<br \/>\n        Arrays.sort(nums);<br \/>\n        \/\/ \u8c03\u7528\u56de\u6eaf\u65b9\u6cd5&#xff0c;\u521d\u59cb\u8d77\u59cb\u7d22\u5f15\u4e3a0&#xff08;\u4ece\u6570\u7ec4\u7b2c\u4e00\u4e2a\u5143\u7d20\u5f00\u59cb\u9009\u62e9&#xff09;<br \/>\n        backtracking(nums, 0);<br \/>\n        return res;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u56de\u6eaf\u6838\u5fc3\u65b9\u6cd5&#xff1a;\u6784\u5efa\u5b50\u96c6\u6811&#xff0c;\u6536\u96c6\u6240\u6709\u8282\u70b9\u7684\u8def\u5f84&#xff0c;\u540c\u65f6\u8df3\u8fc7\u540c\u5c42\u91cd\u590d\u5143\u7d20\u53bb\u91cd<br \/>\n     * &#064;param nums \u6392\u5e8f\u540e\u7684\u6574\u6570\u6570\u7ec4&#xff08;\u76f8\u540c\u5143\u7d20\u76f8\u90bb&#xff09;<br \/>\n     * &#064;param startIndex \u5f53\u524d\u9009\u62e9\u5143\u7d20\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u63a7\u5236\u9009\u62e9\u8303\u56f4&#xff0c;\u907f\u514d\u8de8\u5c42\u91cd\u590d&#xff09;<br \/>\n     *\/<br \/>\n    public void backtracking(int[] nums, int startIndex) {<br \/>\n        \/\/ \u6838\u5fc3\u6b65\u9aa4&#xff1a;\u8fdb\u5165\u9012\u5f52\u7acb\u5373\u6536\u96c6\u5f53\u524d\u8def\u5f84 \u2192 \u5b50\u96c6\u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u90fd\u662f\u5408\u6cd5\u5b50\u96c6<br \/>\n        \/\/ \u5fc5\u987bnew ArrayList&lt;&gt;(path)&#xff1a;\u4fdd\u5b58\u5f53\u524d\u8def\u5f84\u5feb\u7167&#xff0c;\u907f\u514d\u5f15\u7528\u8986\u76d6&#xff08;\u666e\u901a\u5b50\u96c6\u7684\u6838\u5fc3\u5751&#xff09;<br \/>\n        res.add(new ArrayList&lt;&gt;(path));<\/p>\n<p>        \/\/ \u7ec8\u6b62\u6761\u4ef6&#xff1a;\u8d77\u59cb\u7d22\u5f15\u8d85\u51fa\u6570\u7ec4\u957f\u5ea6&#xff0c;\u65e0\u5143\u7d20\u53ef\u518d\u9009\u62e9&#xff0c;\u76f4\u63a5\u8fd4\u56de<br \/>\n        \/\/ \u6ce8&#xff1a;\u53ef\u7701\u7565&#xff0c;for\u5faa\u73af\u4f1a\u56e0i &lt; nums.length\u81ea\u52a8\u7ec8\u6b62&#xff0c;\u6b64\u5904\u505a\u9632\u5fa1\u6027\u5224\u65ad\u66f4\u5065\u58ee<br \/>\n        if (startIndex &gt;&#061; nums.length) {<br \/>\n            return;<br \/>\n        }<\/p>\n<p>        \/\/ \u5355\u5c42\u9012\u5f52\u903b\u8f91&#xff1a;\u4ecestartIndex\u5f00\u59cb\u904d\u5386&#xff0c;\u9009\u62e9\u5143\u7d20\u5e76\u9012\u5f52&#xff0c;\u540c\u65f6\u8df3\u8fc7\u540c\u5c42\u91cd\u590d\u5143\u7d20<br \/>\n        for (int i &#061; startIndex; i &lt; nums.length; i&#043;&#043;) {<br \/>\n            \/\/ \u6838\u5fc3\u6b65\u9aa42&#xff1a;\u540c\u5c42\u53bb\u91cd \u2192 \u8df3\u8fc7\u5f53\u524d\u5c42\u7684\u91cd\u590d\u5143\u7d20&#xff0c;\u907f\u514d\u751f\u6210\u91cd\u590d\u5b50\u96c6<br \/>\n            \/\/ \u6761\u4ef6\u89e3\u8bfb&#xff1a;<br \/>\n            \/\/ 1. i &gt; startIndex&#xff1a;\u8868\u793a\u5f53\u524d\u5143\u7d20\u4e0d\u662f\u5f53\u524d\u5c42\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20&#xff08;\u540c\u5c42\u540e\u7eed\u5143\u7d20&#xff09;<br \/>\n            \/\/ 2. nums[i] &#061;&#061; nums[i-1]&#xff1a;\u8868\u793a\u5f53\u524d\u5143\u7d20\u4e0e\u524d\u4e00\u4e2a\u5143\u7d20\u76f8\u540c<br \/>\n            \/\/ \u6ee1\u8db3\u5219\u8df3\u8fc7&#xff0c;\u4e0d\u9009\u62e9\u5f53\u524d\u5143\u7d20<br \/>\n            if (i &gt; startIndex &amp;&amp; nums[i] &#061;&#061; nums[i &#8211; 1]) {<br \/>\n                continue;<br \/>\n            }<br \/>\n            path.add(nums[i]); \/\/ \u9009\u62e9\u5f53\u524d\u5143\u7d20nums[i]&#xff0c;\u52a0\u5165\u8def\u5f84\u96c6<br \/>\n            backtracking(nums, i &#043; 1); \/\/ \u9012\u5f52&#xff1a;\u9009\u62e9\u4e0b\u4e00\u4e2a\u5143\u7d20&#xff0c;\u8d77\u59cb\u7d22\u5f15\u4e3ai&#043;1&#xff08;\u907f\u514d\u8de8\u5c42\u91cd\u590d&#xff09;<br \/>\n            path.remove(path.size() &#8211; 1); \/\/ \u56de\u6eaf&#xff1a;\u79fb\u9664\u8def\u5f84\u96c6\u6700\u540e\u4e00\u4e2a\u5143\u7d20&#xff0c;\u6062\u590d\u9012\u5f52\u524d\u7684\u72b6\u6001<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n","protected":false},"excerpt":{"rendered":"<p>1 \u4eca\u65e5\u6253\u5361<br \/>\n\u590d\u539fIP\u5730\u5740\u00a093. \u590d\u539f IP \u5730\u5740 &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<br \/>\n\u5b50\u96c6\u00a078. \u5b50\u96c6 &#8211; \u529b\u6263&#xff08;LeetCode&#xff09;<br \/>\n\u5b50\u96c6\u2161\u00a090. \u5b50\u96c6 II &#8211; \u529b\u6263&#xff08;LeetCode&#xff09; 2 \u590d\u539fIP\u5730\u5740<br \/>\n2.1 \u601d\u8def<br \/>\nstartIndex&#xff1a;\u5b57\u7b26\u4e32\u5f53\u524d\u5206\u5272\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u907f\u514d\u91cd\u590d\u5206\u5272\u5b57\u7b26&#xff09; pointNum&#xff1a;\u5df2\u6dfb\u52a0\u7684\u70b9\u7684\u6570\u91cf&amp;#<\/p>\n","protected":false},"author":2,"featured_media":72660,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7058,7644,7645,427],"topic":[],"class_list":["post-72662","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-hot100","tag-7644","tag-7645","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983 - \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\/72662.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1 \u4eca\u65e5\u6253\u5361 \u590d\u539fIP\u5730\u5740\u00a093. \u590d\u539f IP \u5730\u5740 - \u529b\u6263&#xff08;LeetCode&#xff09; \u5b50\u96c6\u00a078. \u5b50\u96c6 - \u529b\u6263&#xff08;LeetCode&#xff09; \u5b50\u96c6\u2161\u00a090. \u5b50\u96c6 II - \u529b\u6263&#xff08;LeetCode&#xff09; 2 \u590d\u539fIP\u5730\u5740 2.1 \u601d\u8def startIndex&#xff1a;\u5b57\u7b26\u4e32\u5f53\u524d\u5206\u5272\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u907f\u514d\u91cd\u590d\u5206\u5272\u5b57\u7b26&#xff09; pointNum&#xff1a;\u5df2\u6dfb\u52a0\u7684\u70b9\u7684\u6570\u91cf&amp;#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/72662.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-06T03:17:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260206031729-69855d49ebd3b.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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72662.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/72662.html\",\"name\":\"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-06T03:17:32+00:00\",\"dateModified\":\"2026-02-06T03:17:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/72662.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/72662.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72662.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983\"}]},{\"@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":"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983 - \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\/72662.html","og_locale":"zh_CN","og_type":"article","og_title":"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1 \u4eca\u65e5\u6253\u5361 \u590d\u539fIP\u5730\u5740\u00a093. \u590d\u539f IP \u5730\u5740 - \u529b\u6263&#xff08;LeetCode&#xff09; \u5b50\u96c6\u00a078. \u5b50\u96c6 - \u529b\u6263&#xff08;LeetCode&#xff09; \u5b50\u96c6\u2161\u00a090. \u5b50\u96c6 II - \u529b\u6263&#xff08;LeetCode&#xff09; 2 \u590d\u539fIP\u5730\u5740 2.1 \u601d\u8def startIndex&#xff1a;\u5b57\u7b26\u4e32\u5f53\u524d\u5206\u5272\u7684\u8d77\u59cb\u7d22\u5f15&#xff08;\u907f\u514d\u91cd\u590d\u5206\u5272\u5b57\u7b26&#xff09; pointNum&#xff1a;\u5df2\u6dfb\u52a0\u7684\u70b9\u7684\u6570\u91cf&amp;#","og_url":"https:\/\/www.wsisp.com\/helps\/72662.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-06T03:17:32+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260206031729-69855d49ebd3b.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/72662.html","url":"https:\/\/www.wsisp.com\/helps\/72662.html","name":"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-06T03:17:32+00:00","dateModified":"2026-02-06T03:17:32+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/72662.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/72662.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/72662.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"day24 \u4ee3\u7801\u968f\u60f3\u5f55\u7b97\u6cd5\u8bad\u7ec3\u8425 \u56de\u6eaf\u4e13\u98983"}]},{"@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\/72662","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=72662"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/72662\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/72660"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=72662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=72662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=72662"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=72662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}