1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-09 01:11:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

移除零宽空格

This commit is contained in:
2025-05-25 15:06:02 +08:00
parent 59597532bc
commit 3070bed723
272 changed files with 1031 additions and 749 deletions

View File

@@ -7,9 +7,9 @@
"boundTopicId": 543102,
"title": "Count Good Meals",
"titleSlug": "count-good-meals",
"content": "<p>A <strong>good meal</strong> is a meal that contains <strong>exactly two different food items</strong> with a sum of deliciousness equal to a power of two.</p>\n\n<p>You can pick <strong>any</strong> two different foods to make a good meal.</p>\n\n<p>Given an array of integers <code>deliciousness</code> where <code>deliciousness[i]</code> is the deliciousness of the <code>i<sup>th</sup></code> item of food, return <em>the number of different <strong>good meals</strong> you can make from this list modulo</em> <code>10<sup>9</sup> + 7</code>.</p>\n\n<p>Note that items with different indices are considered different even if they have the same deliciousness value.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> deliciousness = [1,3,5,7,9]\n<strong>Output:</strong> 4\n<strong>Explanation: </strong>The good meals are (1,3), (1,7), (3,5) and, (7,9).\nTheir respective sums are 4, 8, 8, and 16, all of which are powers of 2.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> deliciousness = [1,1,1,3,3,3,7]\n<strong>Output:</strong> 15\n<strong>Explanation: </strong>The good meals are (1,1) with 3 ways, (1,3) with 9 ways, and (1,7) with 3 ways.</pre>\n\n<p>&nbsp;</p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= deliciousness.length &lt;= 10<sup>5</sup></code></li>\n\t<li><code>0 &lt;= deliciousness[i] &lt;= 2<sup>20</sup></code></li>\n</ul>\n",
"content": "<p>A <strong>good meal</strong> is a meal that contains <strong>exactly two different food items</strong> with a sum of deliciousness equal to a power of two.</p>\n\n<p>You can pick <strong>any</strong> two different foods to make a good meal.</p>\n\n<p>Given an array of integers <code>deliciousness</code> where <code>deliciousness[i]</code> is the deliciousness of the <code>i<sup>th</sup></code> item of food, return <em>the number of different <strong>good meals</strong> you can make from this list modulo</em> <code>10<sup>9</sup> + 7</code>.</p>\n\n<p>Note that items with different indices are considered different even if they have the same deliciousness value.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> deliciousness = [1,3,5,7,9]\n<strong>Output:</strong> 4\n<strong>Explanation: </strong>The good meals are (1,3), (1,7), (3,5) and, (7,9).\nTheir respective sums are 4, 8, 8, and 16, all of which are powers of 2.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> deliciousness = [1,1,1,3,3,3,7]\n<strong>Output:</strong> 15\n<strong>Explanation: </strong>The good meals are (1,1) with 3 ways, (1,3) with 9 ways, and (1,7) with 3 ways.</pre>\n\n<p>&nbsp;</p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= deliciousness.length &lt;= 10<sup>5</sup></code></li>\n\t<li><code>0 &lt;= deliciousness[i] &lt;= 2<sup>20</sup></code></li>\n</ul>\n",
"translatedTitle": "大餐计数",
"translatedContent": "<p><strong>大餐</strong> 是指 <strong>恰好包含两道不同餐品</strong> 的一餐,其美味程度之和等于 2 的幂。</p>\n\n<p>你可以搭配 <strong>任意</strong> 两道餐品做一顿大餐。</p>\n\n<p>给你一个整数数组 <code>deliciousness</code> ,其中 <code>deliciousness[i]</code> 是第 <code>i<sup></sup></code> 道餐品的美味程度,返回你可以用数组中的餐品做出的不同 <strong>大餐</strong> 的数量。结果需要对 <code>10<sup>9</sup> + 7</code> 取余。</p>\n\n<p>注意,只要餐品下标不同,就可以认为是不同的餐品,即便它们的美味程度相同。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>deliciousness = [1,3,5,7,9]\n<strong>输出:</strong>4\n<strong>解释:</strong>大餐的美味程度组合为 (1,3) 、(1,7) 、(3,5) 和 (7,9) 。\n它们各自的美味程度之和分别为 4 、8 、8 和 16 ,都是 2 的幂。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>deliciousness = [1,1,1,3,3,3,7]\n<strong>输出:</strong>15\n<strong>解释:</strong>大餐的美味程度组合为 3 种 (1,1) 9 种 (1,3) ,和 3 种 (1,7) 。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= deliciousness.length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= deliciousness[i] <= 2<sup>20</sup></code></li>\n</ul>\n",
"translatedContent": "<p><strong>大餐</strong> 是指 <strong>恰好包含两道不同餐品</strong> 的一餐,其美味程度之和等于 2 的幂。</p>\n\n<p>你可以搭配 <strong>任意</strong> 两道餐品做一顿大餐。</p>\n\n<p>给你一个整数数组 <code>deliciousness</code> ,其中 <code>deliciousness[i]</code> 是第 <code>i<sup></sup></code> 道餐品的美味程度,返回你可以用数组中的餐品做出的不同 <strong>大餐</strong> 的数量。结果需要对 <code>10<sup>9</sup> + 7</code> 取余。</p>\n\n<p>注意,只要餐品下标不同,就可以认为是不同的餐品,即便它们的美味程度相同。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>deliciousness = [1,3,5,7,9]\n<strong>输出:</strong>4\n<strong>解释:</strong>大餐的美味程度组合为 (1,3) 、(1,7) 、(3,5) 和 (7,9) 。\n它们各自的美味程度之和分别为 4 、8 、8 和 16 ,都是 2 的幂。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>deliciousness = [1,1,1,3,3,3,7]\n<strong>输出:</strong>15\n<strong>解释:</strong>大餐的美味程度组合为 3 种 (1,1) 9 种 (1,3) ,和 3 种 (1,7) 。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= deliciousness.length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= deliciousness[i] <= 2<sup>20</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 151,