{"id":234,"date":"2024-11-30T10:33:43","date_gmt":"2024-11-30T02:33:43","guid":{"rendered":"http:\/\/getzs.online\/?p=234"},"modified":"2024-11-30T10:33:43","modified_gmt":"2024-11-30T02:33:43","slug":"leetcode-%e6%af%8f%e6%97%a5%e4%b8%80%e9%a2%98-24-11-30","status":"publish","type":"post","link":"https:\/\/hello.getzs.online\/index.php\/2024\/11\/30\/leetcode-%e6%af%8f%e6%97%a5%e4%b8%80%e9%a2%98-24-11-30\/","title":{"rendered":"LeetCode \u6bcf\u65e5\u4e00\u9898 24.11.30"},"content":{"rendered":"\n<p><a href=\"https:\/\/leetcode.cn\/problems\/find-if-digit-game-can-be-won\/description\">3232. \u5224\u65ad\u662f\u5426\u53ef\u4ee5\u8d62\u5f97\u6570\u5b57\u6e38\u620f<\/a><\/p>\n\n\n\n<p>\u7ed9\u4f60\u4e00\u4e2a&nbsp;<strong>\u6b63\u6574\u6570&nbsp;<\/strong>\u6570\u7ec4&nbsp;<code>nums<\/code>\u3002<\/p>\n\n\n\n<p>Alice \u548c Bob \u6b63\u5728\u73a9\u6e38\u620f\u3002\u5728\u6e38\u620f\u4e2d\uff0cAlice \u53ef\u4ee5\u4ece&nbsp;<code>nums<\/code>&nbsp;\u4e2d\u9009\u62e9\u6240\u6709\u4e2a\u4f4d\u6570&nbsp;<strong>\u6216<\/strong>&nbsp;\u6240\u6709\u4e24\u4f4d\u6570\uff0c\u5269\u4f59\u7684\u6570\u5b57\u5f52 Bob \u6240\u6709\u3002\u5982\u679c Alice \u6240\u9009\u6570\u5b57\u4e4b\u548c&nbsp;<strong>\u4e25\u683c\u5927\u4e8e&nbsp;<\/strong>Bob \u7684\u6570\u5b57\u4e4b\u548c\uff0c\u5219 Alice \u83b7\u80dc\u3002<\/p>\n\n\n\n<p>\u5982\u679c Alice \u80fd\u8d62\u5f97\u8fd9\u573a\u6e38\u620f\uff0c\u8fd4\u56de&nbsp;<code>true<\/code>\uff1b\u5426\u5219\uff0c\u8fd4\u56de&nbsp;<code>false<\/code>\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<p><strong>\u8f93\u5165\uff1a<\/strong>nums = [1,2,3,4,10]<\/p>\n\n\n\n<p><strong>\u8f93\u51fa\uff1a<\/strong>false<\/p>\n\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<p>Alice&nbsp;\u4e0d\u7ba1\u9009\u4e2a\u4f4d\u6570\u8fd8\u662f\u4e24\u4f4d\u6570\u90fd\u65e0\u6cd5\u8d62\u5f97\u6bd4\u8d5b\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><\/p>\n\n\n\n<p><strong>\u8f93\u5165\uff1a<\/strong>nums = [1,2,3,4,5,14]<\/p>\n\n\n\n<p><strong>\u8f93\u51fa\uff1a<\/strong>true<\/p>\n\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<p>Alice&nbsp;\u9009\u62e9\u4e2a\u4f4d\u6570\u53ef\u4ee5\u8d62\u5f97\u6bd4\u8d5b\uff0c\u6240\u9009\u6570\u5b57\u4e4b\u548c\u4e3a 15\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 3\uff1a<\/strong><\/p>\n\n\n\n<p><strong>\u8f93\u5165\uff1a<\/strong>nums = [5,5,5,25]<\/p>\n\n\n\n<p><strong>\u8f93\u51fa\uff1a<\/strong>true<\/p>\n\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<p>Alice&nbsp;\u9009\u62e9\u4e24\u4f4d\u6570\u53ef\u4ee5\u8d62\u5f97\u6bd4\u8d5b\uff0c\u6240\u9009\u6570\u5b57\u4e4b\u548c\u4e3a 25\u3002<\/p>\n\n\n\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>1 &lt;= nums.length &lt;= 100<\/code><\/li>\n\n\n\n<li><code>1 &lt;= nums[i] &lt;= 99<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b80\u5355\u6a21\u62df\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\tpublic boolean canAliceWin(int&#91;] nums) {\n\t\tint bit = Arrays.stream(nums).map(num -> num &lt; 10 ? num : 0).sum();\n\t\tint remainder = Arrays.stream(nums).map(num -> num >= 10 ? num : 0).sum();\n\t\treturn bit != remainder;\n\t}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>3232. \u5224\u65ad\u662f\u5426\u53ef\u4ee5\u8d62\u5f97\u6570\u5b57\u6e38\u620f \u7ed9\u4f60\u4e00\u4e2a&nbsp;\u6b63\u6574\u6570&nbsp;\u6570\u7ec4&nbsp;nums\u3002 Ali [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[5],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-leetcode","tag-leetcode-"],"_links":{"self":[{"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/comments?post=234"}],"version-history":[{"count":2,"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/posts\/234\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/media?parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/categories?post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hello.getzs.online\/index.php\/wp-json\/wp\/v2\/tags?post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}