{"id":326081,"date":"2021-02-04T20:11:42","date_gmt":"2021-02-04T12:11:42","guid":{"rendered":"http:\/\/4563.org\/?p=326081"},"modified":"2021-02-04T20:11:42","modified_gmt":"2021-02-04T12:11:42","slug":"%e5%88%b7-leetcode-%e4%bd%bf%e7%94%a8-python-%e8%bf%98%e6%98%af-c%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=326081","title":{"rendered":"\u5237 leetcode \u4f7f\u7528 Python \u8fd8\u662f c++\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5237 leetcode \u4f7f\u7528 Python \u8fd8\u662f c++\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hakunamatata11 <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u8eab\u8fb9 80%\u7684\u7a0b\u5e8f\u5458\u670b\u53cb\u5728\u5237\u9898\u7684\u65f6\u5019\u4f1a\u9009\u62e9 Java\uff0c\u5f88\u5c11\u6709\u4eba\u7528 C++\u6765\u5237\u9898\u3002<\/p>\n<p>\u8fd9\u4e24\u95e8\u8bed\u8a00\u5404\u6709\u7279\u70b9\uff1a<\/p>\n<p><strong>C++\uff1a<\/strong>\u4ece C \u8bed\u8a00\u53d1\u5c55\u8fc7\u6765\u7684\u4e00\u95e8\u8bed\u8a00\uff0c\u7ee7\u627f\u4e86\u7075\u6d3b\uff08\u53ef\u4ee5\u6f5c\u5165\u4efb\u4f55\u73b0\u4ee3\u7684\u5904\u7406\u5668\u4e2d\uff0c\uff09\uff0c\u9ad8\u6548\uff0c\u7b80\u6d01\u7b49\u8bed\u8a00\u7279\u5f81\u3002\u4e0d\u8fc7\u60f3\u5b66\u597d C++\u82b1 3 \u5e74\u65f6\u95f4\u90fd\u7b97\u5c11\u7684\uff0c\u4e0d\u8fc7\u60f3\u8981\u6210\u4e3a\u9876\u7ea7\u7a0b\u5e8f\u5458\uff0c\u8fd8\u662f\u53ef\u4ee5\u5b66\u4e00\u4e0b C++\u3002<\/p>\n<p><strong>Java\uff1a<\/strong>Java \u548c C++\u4e00\u6837\u662f\u4e00\u95e8\u7f16\u8bd1\u5f62\u8bed\u8a00\u3002\u4e0d\u8fc7\u4e0d\u540c\u7684\u662f\uff0cJava \u662f\u201c\u6c42\u804c\u4e07\u91d1\u6cb9\u201d\u3002\u4e8c\u5341\u591a\u5e74\u6765\uff0c\u4e00\u76f4\u90fd\u662f\u4e3b\u6d41\u7684\u5f00\u53d1\u8bed\u8a00\uff0c\u4e14\u62e5\u6709\u4e16\u754c\u4e0a\u6570\u91cf\u6700\u591a\u7684\u7a0b\u5e8f\u5458\u3002\u5bf9\u4e8e\u65b0\u624b\u6765\u8bf4\uff0cJava \u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u7684\u8bed\u8a00\u672c\u8eab\u4e0d\u592a\u96be\uff0c\u5bf9\u5c0f\u767d\u5f88\u53cb\u597d\u3002Java \u7684\u8fd0\u884c\u6548\u7387\u9ad8\uff0c\u7ecf\u5e38\u7528\u4e8e\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\uff0c\u5546\u4e1a\u5f00\u53d1\u7b49\u3002<\/p>\n<p>\u4e0d\u8fc7\u60f3\u8981\u8ba9\u8bed\u8a00\u5728\u5237\u9898\u4e2d\u6709\u4f18\u52bf\uff0c\u6211\u5efa\u8bae\u4e00\u5b9a\u8981<strong>\u6253\u597d\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u7684\u57fa\u7840<\/strong>\u3002\u6709\u4e9b\u4eba\u867d\u7136\u5df2\u7ecf\u662f\u5de5\u4f5c\u4e86\u51e0\u5e74\u7684\u7a0b\u5e8f\u5458\u201c\u8001\u624b\u201d\uff0c\u4f46\u662f\u505a\u7b97\u6cd5\u9898\u80fd\u529b\u751a\u81f3\u4e0d\u5982\u4e00\u4e2a\u5e94\u5c4a\u6bd5\u4e1a\u751f\u3002\u5c31\u662f\u56e0\u4e3a\u4ece\u4e00\u5f00\u59cb\u5c31\u6ca1\u6709\u628a\u57fa\u7840\u6253\u597d\uff0c\u751a\u81f3\u5728\u5de5\u4f5c\u591a\u5e74\u4ee5\u540e\u8d8a\u6765\u8d8a\u5dee\uff0c\u4e0b\u9762\u5206\u4eab\u4e00\u4e9b\u6211\u5728\u63d0\u9ad8\u7b97\u6cd5\u80fd\u529b\u524d\u671f\u51c6\u5907\u9636\u6bb5\u7528\u7684\u4e00\u4e9b\u8d44\u6599\uff1a<\/p>\n<p>1 \u3001\u300a<strong>Java \u7f16\u7a0b\u89c4\u8303<\/strong>\u300b\uff1a\u9002\u5408\u5165\u95e8\u7684\u521d\u5b66\u8005\uff0c\u628a java \u7684\u57fa\u7840\u8bed\u8a00\u90fd\u6709\u8bb2\u5230\u3002\u8fd9\u672c\u4e66\u4e3b\u8981\u662f\u4e3a\u4e86\u4ece\u57fa\u7840\u57f9\u517b Java \u7684\u8bed\u8a00\u89c4\u8303\uff0c\u7136\u800c\u7f16\u7a0b\u8bed\u8a00\u7684\u89c4\u8303\u53ef\u4ee5\u5f88\u5927\u63d0\u9ad8\u65e5\u540e\u7684\u5de5\u4f5c\u6548\u7387\uff0c\u4e5f\u80fd\u5728\u9762\u8bd5\u4e2d\u7ed9\u9762\u8bd5\u5b98\u5e26\u6765\u4e00\u4e2a\u597d\u5370\u8c61\u3002<\/p>\n<p>2 \u3001\u300a<strong>\u4e5d\u7ae0\u7b97\u6cd5\u57fa\u7840\u73ed Java+Python<\/strong>\u300b\u8bfe\u7a0b\u91cc\u6709\u9488\u5bf9\u6570\u636e\u7ed3\u6784\u548c\u57fa\u7840\u7b97\u6cd5\u8be6\u7ec6\u5730\u8bb2\u89e3\uff0c\u8bfe\u4e0a\u8fd8\u6709\u624b\u628a\u624b coding \u7684\u8fc7\u7a0b\uff0c\u7279\u522b\u9002\u5408\u57fa\u7840\u4e0d\u597d\u6216\u8005\u521a\u5165\u95e8\u7684\u540c\u5b66\u3002<\/p>\n<blockquote>\n<h2><strong>\u6233\u6211\u62a5\u540d\u514d\u8d39\u8bd5\u542c\u524d\u4e09\u7ae0<\/strong><\/h2>\n<\/blockquote>\n<p>3 \u3001[\u300a<strong>Java \u7f16\u7a0b\u601d\u60f3<\/strong>\u300b]( https:\/\/pan.baidu.com\/disk\/pdfview?path=\/\u6211\u7684\u8d44\u6e90 \/\u7535\u5b50\u4e66 \/\u7535\u5b50\u4e66 \/java \u7f16\u7a0b\u601d\u60f3 \/Java \u7f16\u7a0b\u601d\u60f3(\u7b2c 4 \u7248).pdf)\uff1a\u521d\u7ea7\u4e2d\u7ea7\u90fd\u53ef\u4ee5\uff0c\u6700\u7ecf\u5178\u7684 Java \u8457\u4f5c\uff0c\u6709\u6bd4\u8f83\u901a\u4fd7\u6613\u61c2\u7684\u5b9e\u4f8b\uff0c\u6df1\u523b\u9886\u609f java \u7684\u7cbe\u9ad3\u3002\u4f46\u662f\u9700\u8981\u82b1\u65f6\u95f4\u7ec6\u7ec6\u7814\u8bfb\u3002<\/p>\n<p>\u8bb2\u5230\u9009\u8bed\u8a00\u5927\u5bb6\u90fd\u662f\u4e3a\u4e86\u6548\u7387\u9ad8\uff0c\u5176\u5b9e\u9664\u4e86\u9009\u5bf9\u4e00\u95e8\u9002\u5408\u81ea\u5df1\u7684\u8bed\u8a00\u4ee5\u5916\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4e00\u5957\u5408\u9002\u7684\u5237\u9898\u6b65\u9aa4\u6765\u63d0\u9ad8\u5237\u9898\u7684\u6548\u7387\uff0c\u4ee5\u4e0b\u7528\u6211\u81ea\u5df1\u6700\u5e38\u7528\u7684\u4e00\u4e2a\u5237\u9898\u8f6f\u4ef6LintCode\u6765\u4e3e\u4f8b\uff0c\u5927\u5bb6\u53ef\u4ee5\u4e3e\u4e00\u53cd\u4e09\u3002<\/p>\n<h2>\u4e00\u3001\u660e\u786e\u81ea\u5df1\u7684\u9762\u8bd5\u76ee\u7684<\/h2>\n<p>\u9996\u5148\u4f60\u8981\u660e\u786e\u81ea\u5df1\u5237\u9898\u7684\u76ee\u7684\uff0c\u6bd4\u5982\u5f53\u65f6\u6211\u81ea\u5df1\u662f\u4e3a\u4e86\u9762\u8bd5\u6240\u4ee5\u5f00\u542f\u4e86\u6211\u62fc\u547d\u5237\u9898\u7684\u9053\u8def\u3002\u7b2c\u4e00\u6b65\u6211\u505a\u7684\u5c31\u662f\u5148\u628a\u4e00\u4e9b\u9762\u8bd5\u9ad8\u9891\u8003\u70b9\u6574\u7406\u51fa\u6765\uff0c\u4ee5\u4e0b\u662f\u6211\u5f53\u65f6\u4ee5\u4e0b\u662f\u5728\u4e0a\u300a<strong>\u4e5d\u7ae0\u7b97\u6cd5 2021<\/strong>\u300b\u65f6\u8001\u5e08\u603b\u7ed3\u7684\u9762\u8bd5\u9ad8\u9891\u8003\u70b9\uff0c\u989c\u8272\u8d8a\u6df1\u9762\u8bd5\u8003\u9891\u8d8a\u9ad8\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/02\/20210208_6020d01136bc7.png\" alt=\"\u5237 leetcode \u4f7f\u7528 Python \u8fd8\u662f c++\uff1f\" \/><\/p>\n<p>\u5982\u679c\u6f2b\u65e0\u76ee\u7684\u5730\u5237\u9898\uff0c\u82b1\u8d39\u597d\u51e0\u5929\u89e3\u5f00\u4e00\u9053\u6839\u672c\u4e0d\u4f1a\u8003\u7684\u56f0\u96be\u9898\u578b\uff0c\u8fd9\u6837\u7684\u5237\u9898\u65b9\u5f0f\u4e0d\u4ec5\u7d2f\uff0c\u800c\u4e14\u5728\u9762\u8bd5\u7684\u65f6\u5019\u8fd8\u662f\u6beb\u65e0\u4f18\u52bf\u3002\u6240\u4ee5\u6211\u5efa\u8bae\u5728\u5237\u9898\u7684\u65f6\u5019\u5148\u6311\u9ad8\u9891\u77e5\u8bc6\u70b9\u5237\uff0c\u5148\u628a\u77e5\u8bc6\u70b9\u719f\u6089\u4e00\u904d\uff0c\u518d\u53bb\u7cbe\u5237 2~3 \u904d\uff0c\u8fd9\u6837\u5237\u9898\u7684\u6548\u679c\u4f1a\u66f4\u597d\u3002<\/p>\n<h2>\u4e8c\u3001\u5229\u7528 tag \u8fdb\u884c\u5237\u9898<\/h2>\n<p>\u7136\u540e\u5c31\u662f\u6839\u636e\u81ea\u5df1\u6574\u7406\u7684\u9ad8\u9891\u8003\u70b9\u5f00\u59cb\u5237\u9898\uff0c\u6bd4\u5982\u6211\u4f1a\u5728LintCode\u4e0a\u627e\u5230\u5bf9\u5e94\u7684\u4e8c\u53c9\u6811\u77e5\u8bc6\u70b9\uff0c\u7136\u540e\u8fdb\u5165\u7ea0\u7ed3\u75c7\u60a3\u8005\u6700\u559c\u6b22\u7684\u6b65\u9aa4\u2014\u2014\u5e2e\u6211\u9009\u4e00\u9898\uff0c\u7cfb\u7edf\u63a8\u8350\u4ec0\u4e48\u6211\u5c31\u505a\u4ec0\u4e48\u3002\u5982\u679c\u505a\u5b8c\u89c9\u5f97\u96be\u5ea6\u592a\u9ad8\uff0c\u5c31\u81ea\u884c\u964d\u4f4e\u96be\u5ea6\u5f00\u59cb\u7ec3\u4e60\uff0c\u4ece\u7b80\u5355\u9898\u5f00\u59cb\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/02\/20210208_6020d01711239.png\" alt=\"\u5237 leetcode \u4f7f\u7528 Python \u8fd8\u662f c++\uff1f\" \/><\/p>\n<p>\u6bcf\u6b21\u505a\u5b8c\u90fd\u8981\u603b\u7ed3\uff0c\u56e0\u4e3a\u4e00\u4e2a\u77e5\u8bc6\u70b9\u53ef\u4ee5\u53d8\u5316\u51fa\u5f88\u591a\u4e0d\u540c\u7684\u8003\u8bd5\u9898\u578b\u3002\u6240\u4ee5\u5237\u591a\u5c11\u9898\u90fd\u4e0d\u5982\uff0c\u6574\u7406\u51fa\u5bf9\u5e94\u77e5\u8bc6\u70b9\u7684\u89e3\u9898\u601d\u8def\uff0c\u8fd9\u6837\u624d\u80fd\u8ba9\u4f60\u5728\u770b\u5230\u4efb\u4e00\u53d8\u578b\u9898\u7684\u65f6\u5019\u80fd\u7acb\u9a6c\u60f3\u5230\u91c7\u7528\u54ea\u79cd\u65b9\u5f0f\u89e3\u9898\uff0c\u8fd9\u624d\u662f\u9ad8\u6548\u5237\u9898\u7684\u6700\u7ec8\u76ee\u7684\u3002<\/p>\n<p>\u9664\u4e86\u6309\u7167\u77e5\u8bc6\u70b9\u7684 tag \u8fdb\u884c\u5237\u9898\uff0c\u5982\u679c\u4f60\u548c\u6211\u4e00\u6837\u6709\u660e\u786e\u7684\u76ee\u6807\u516c\u53f8\uff0c\u4f60\u8fd8\u53ef\u4ee5\u5728LintCode\u91cc\u627e\u5237\u8be5\u516c\u53f8\u7684\u5e38\u8003\u9898\u3001\u5fc5\u8003\u9898\uff0c\u91cc\u9762\u542b\u6982\u4e86\u56fd\u5185\u56fd\u5916\u4e92\u8054\u7f51\u516c\u53f8\u7684\u6700\u65b0\u7684\u9762\u8bd5\u771f\u9898\uff0c\u5237\u5b8c\u4e00\u5957\uff0c\u6211\u5c31\u4f1a\u81ea\u5df1\u53bb\u603b\u7ed3\u4e00\u4e0b\u8fd9\u4e2a\u516c\u53f8\u7684\u9762\u8bd5\u5957\u8def\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/02\/20210208_6020d01c3d357.png\" alt=\"\u5237 leetcode \u4f7f\u7528 Python \u8fd8\u662f c++\uff1f\" \/><\/p>\n<h2>\u4e09\u3001\u201c\u5c11\u201d\u5237\u9898<\/h2>\n<p>\u672c\u4eba\u4e0d\u63d0\u5021\u591a\u5237\u9898\uff0c\u4f46\u6211\u63d0\u5021\u4e00\u9898\u591a\u5237\uff0c\u82b1\u65f6\u95f4\u628a\u4e00\u9053\u81ea\u5df1\u4e0d\u4f1a\u505a\u7684\u9898\uff0c\u4e00\u9053\u6709\u4ef7\u503c\u7684\u9898<strong>\u7cbe\u5237<\/strong>\u3002\u505a\u5230\u5237\u9898 100\uff0c\u80fd\u529b\u8d85\u8fc7\u5237\u9898 300+\uff0c\u9664\u4e86\u4e0a\u8ff0\u7684\u4e00\u4e9b\u5237\u9898\u6b65\u9aa4\uff0c\u8fd9\u91cc\u5206\u4eab\u4e00\u4e0b\u6211\u5728LintCode\u4e0a\u7684\u5237\u9898\u8def\u7ebf\uff0c\u5e0c\u671b\u80fd\u7ed9\u5927\u5bb6\u4e00\u70b9\u5237\u9898\u601d\u8def\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/02\/20210208_6020d02208f71.png\" alt=\"\u5237 leetcode \u4f7f\u7528 Python \u8fd8\u662f c++\uff1f\" \/><\/p>\n<p>\u4ece\u6bd5\u4e1a\u6c42\u804c\u5f00\u59cb\u5c31\u7528LintCode\u5237\u9898\uff0c\u5230\u73b0\u5728\u4e5f\u6709\u4e09\u5e74\u4e86\uff0c\u671f\u95f4\u4e5f\u8bd5\u8fc7\u5f88\u591a\u5176\u4ed6\u4e0d\u540c\u7684\u5237\u9898\u8f6f\u4ef6\uff0c\u8fd8\u662f\u89c9\u5f97LintCode\u6700\u9002\u5408\u6c42\u804c\u9762\u8bd5\u65f6\u5019\u7528\uff0c\u7279\u522b\u662f\u60f3\u8981\u77ed\u671f\u7a81\u51fb\u7684\u540c\u5b66\u6211\u5efa\u8bae\u4f60\u4eec\u76f4\u63a5\u5237LintCode\u91cc\u5927\u5382\u7684\u7b97\u6cd5\u771f\u9898\uff0c\u4eb2\u6d4b\uff0c\u5bf9\u7a81\u51fb\u7b97\u6cd5\u9762\u8bd5\u5f88\u6709\u5e2e\u52a9\uff01<\/p>\n<p>\u6700\u540e\uff0c\u6211\u6839\u636e\u77e5\u8bc6\u70b9\u6574\u7406\u4e86\u4e00\u4e9b\u9ad8\u9891\u9898\uff1a<\/p>\n<h3>\u4e8c\u53c9\u6811\uff1a<\/h3>\n<p><strong>\u4e8c\u53c9\u6811\u7684\u540e\u5e8f\u904d\u5386<\/strong><\/p>\n<p><strong>\u4e8c\u53c9\u6811\u7684\u6240\u6709\u8def\u5f84<\/strong><\/p>\n<p><strong>\u6839\u636e\u524d\u5e8f\u548c\u540e\u5e8f\u904d\u5386\u6784\u9020\u4e8c\u53c9\u6811<\/strong><\/p>\n<p><strong>\u5bf9\u79f0\u6811<\/strong><\/p>\n<p><strong>\u627e\u51fa\u6811\u4e2d\u6bcf\u884c\u7684\u6700\u5927\u503c<\/strong><\/p>\n<p><strong>\u5bfb\u627e\u91cd\u590d\u7684\u5b50\u6811<\/strong><\/p>\n<h3>\u54c8\u5e0c\u8868\uff1a<\/h3>\n<p><strong>\u4e24\u6570\u4e4b\u548c<\/strong><\/p>\n<p><strong>\u6700\u957f\u56de\u6587\u4e32<\/strong><\/p>\n<p><strong>\u4e24\u6570\u7ec4\u7684\u4ea4\u96c6<\/strong><\/p>\n<p><strong>\u6570\u636e\u6d41\u4e2d\u7b2c\u4e00\u4e2a\u552f\u4e00\u7684\u6570\u5b57<\/strong><\/p>\n<p><strong>\u4e24\u6570\u548c II-\u8f93\u5165\u5df2\u6392\u5e8f\u7684\u6570\u7ec4<\/strong><\/p>\n<h3>\u4e8c\u5206\u6cd5\uff1a<\/h3>\n<p><strong>\u7ecf\u5178\u4e8c\u5206\u67e5\u627e\u95ee\u9898<\/strong><\/p>\n<p><strong>\u641c\u7d22\u65cb\u8f6c\u6392\u5e8f\u6570\u7ec4<\/strong><\/p>\n<p><strong>\u5bfb\u627e\u5cf0\u503c<\/strong><\/p>\n<p><strong>\u6700\u957f\u4e0a\u5347\u5b50\u5e8f\u5217<\/strong><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5237 leetcode \u4f7f\u7528 Pyt&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/326081"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326081"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/326081\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326081"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}