{"id":2152,"date":"2022-01-19T18:39:27","date_gmt":"2022-01-19T10:39:27","guid":{"rendered":"http:\/\/139.9.1.231\/?p=2152"},"modified":"2022-01-19T18:39:28","modified_gmt":"2022-01-19T10:39:28","slug":"leetcodeday43","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2022\/01\/19\/leetcodeday43\/","title":{"rendered":"leetcodeday43 &#8211;\u5b57\u7b26\u4e32\u76f8\u4e58"},"content":{"rendered":"\n<p>\u7ed9\u5b9a\u4e24\u4e2a\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\u8868\u793a\u7684\u975e\u8d1f\u6574\u6570&nbsp;<code>num1<\/code>&nbsp;\u548c&nbsp;<code>num2<\/code>\uff0c\u8fd4\u56de&nbsp;<code>num1<\/code>&nbsp;\u548c&nbsp;<code>num2<\/code>&nbsp;\u7684\u4e58\u79ef\uff0c\u5b83\u4eec\u7684\u4e58\u79ef\u4e5f\u8868\u793a\u4e3a\u5b57\u7b26\u4e32\u5f62\u5f0f\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165:<\/strong> num1 = \"2\", num2 = \"3\"\n<strong>\u8f93\u51fa:<\/strong> \"6\"<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b&nbsp;2:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165:<\/strong> num1 = \"123\", num2 = \"456\"\n<strong>\u8f93\u51fa:<\/strong> \"56088\"<\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ol><li><code>num1<\/code>&nbsp;\u548c&nbsp;<code>num2<\/code>&nbsp;\u7684\u957f\u5ea6\u5c0f\u4e8e110\u3002<\/li><li><code>num1<\/code>&nbsp;\u548c&nbsp;<code>num2<\/code>&nbsp;\u53ea\u5305\u542b\u6570\u5b57&nbsp;<code>0-9<\/code>\u3002<\/li><li><code>num1<\/code>&nbsp;\u548c&nbsp;<code>num2<\/code>&nbsp;\u5747\u4e0d\u4ee5\u96f6\u5f00\u5934\uff0c\u9664\u975e\u662f\u6570\u5b57 0 \u672c\u8eab\u3002<\/li><li><strong>\u4e0d\u80fd\u4f7f\u7528\u4efb\u4f55\u6807\u51c6\u5e93\u7684\u5927\u6570\u7c7b\u578b\uff08\u6bd4\u5982 BigInteger\uff09<\/strong>\u6216<strong>\u76f4\u63a5\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u6574\u6570\u6765\u5904\u7406<\/strong>\u3002<\/li><\/ol>\n\n\n\n<p>\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># @lc app=leetcode.cn id=43 lang=python3\r\n#\r\n# &#91;43] \u5b57\u7b26\u4e32\u76f8\u4e58\r\n#\r\n\r\n# @lc code=start\r\nclass Solution:\r\n    def multiply(self, num1: str, num2: str) -> str:\r\n        dicts={\"0\":0,\"1\":1,\"2\":2,\"3\":3,\"4\":4,\"5\":5,\"6\":6,\"7\":7,\"8\":8,\"9\":9,\"10\":10}\r\n        def stringToNumber(s):\r\n            mid=0\r\n            for i in  range(len(s)):\r\n                mid=mid*10+dicts&#91;s&#91;i]]\r\n            return mid\r\n        n1=stringToNumber(num1)\r\n        n2=stringToNumber(num2)\r\n        return str(n1*n2)\r\n\r\n            \r\n# @lc code=end<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-243.png\" alt=\"\" class=\"wp-image-2153\" width=\"534\" height=\"197\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-243.png 731w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-243-300x111.png 300w\" sizes=\"(max-width: 534px) 100vw, 534px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed9\u5b9a\u4e24\u4e2a\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\u8868\u793a\u7684\u975e\u8d1f\u6574\u6570&nbsp;num1&nbsp;\u548c&nbsp;num2\uff0c\u8fd4\u56de&nbsp;nu &hellip; <a href=\"http:\/\/139.9.1.231\/index.php\/2022\/01\/19\/leetcodeday43\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">leetcodeday43 &#8211;\u5b57\u7b26\u4e32\u76f8\u4e58<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2152"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=2152"}],"version-history":[{"count":1,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2152\/revisions"}],"predecessor-version":[{"id":2154,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2152\/revisions\/2154"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=2152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=2152"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=2152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}