mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 05:26:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>在整数数组中,如果一个整数的出现频次和它的数值大小相等,我们就称这个整数为「幸运数」。</p>\n\n<p>给你一个整数数组 <code>arr</code>,请你从中找出并返回一个幸运数。</p>\n\n<ul>\n\t<li>如果数组中存在多个幸运数,只需返回 <strong>最大</strong> 的那个。</li>\n\t<li>如果数组中不含幸运数,则返回 <strong>-1 </strong>。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>arr = [2,2,3,4]\n<strong>输出:</strong>2\n<strong>解释:</strong>数组中唯一的幸运数是 2 ,因为数值 2 的出现频次也是 2 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>arr = [1,2,2,3,3,3]\n<strong>输出:</strong>3\n<strong>解释:</strong>1、2 以及 3 都是幸运数,只需要返回其中最大的 3 。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>arr = [2,2,2,3,3]\n<strong>输出:</strong>-1\n<strong>解释:</strong>数组中不存在幸运数。\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre><strong>输入:</strong>arr = [5]\n<strong>输出:</strong>-1\n</pre>\n\n<p><strong>示例 5:</strong></p>\n\n<pre><strong>输入:</strong>arr = [7,7,7,7,7,7,7]\n<strong>输出:</strong>7\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 500</code></li>\n\t<li><code>1 <= arr[i] <= 500</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 31,
|
||||
"likes": 32,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"19.5K\", \"totalSubmission\": \"29.4K\", \"totalAcceptedRaw\": 19522, \"totalSubmissionRaw\": 29416, \"acRate\": \"66.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"20K\", \"totalSubmission\": \"30.1K\", \"totalAcceptedRaw\": 19984, \"totalSubmissionRaw\": 30148, \"acRate\": \"66.3%\"}",
|
||||
"hints": [
|
||||
"Count the frequency of each integer in the array.",
|
||||
"Get all lucky numbers and return the largest of them."
|
||||
|
||||
Reference in New Issue
Block a user