mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 14:58:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个下标从 <strong>0</strong> 开始的整数数组 <code>nums</code> ,同时给你一个整数 <code>key</code> ,它在 <code>nums</code> 出现过。</p>\n\n<p><strong>统计 </strong>在 <code>nums</code> 数组中紧跟着 <code>key</code> 后面出现的不同整数 <code>target</code> 的出现次数。换言之,<code>target</code> 的出现次数为满足以下条件的 <code>i</code> 的数目:</p>\n\n<ul>\n\t<li><code>0 <= i <= n - 2</code></li>\n\t<li><code>nums[i] == key</code> 且</li>\n\t<li><code>nums[i + 1] == target</code> 。</li>\n</ul>\n\n<p>请你返回出现 <strong>最多</strong> 次数的<em> </em><code>target</code> 。测试数据保证出现次数最多的 <code>target</code> 是唯一的。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><b>输入:</b>nums = [1,100,200,1,100], key = 1\n<b>输出:</b>100\n<b>解释:</b>对于 target = 100 ,在下标 1 和 4 处出现过 2 次,且都紧跟着 key 。\n没有其他整数在 key 后面紧跟着出现,所以我们返回 100 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><b>输入:</b>nums = [2,2,2,2,3], key = 2\n<b>输出:</b>2\n<b>解释:</b>对于 target = 2 ,在下标 1 ,2 和 3 处出现过 3 次,且都紧跟着 key 。\n对于 target = 3 ,在下标 4 出出现过 1 次,且紧跟着 key 。\ntarget = 2 是紧跟着 key 之后出现次数最多的数字,所以我们返回 2 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= nums.length <= 1000</code></li>\n\t<li><code>1 <= nums[i] <= 1000</code></li>\n\t<li>测试数据保证答案是唯一的。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 4,
|
||||
"likes": 5,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5.8K\", \"totalSubmission\": \"9.8K\", \"totalAcceptedRaw\": 5753, \"totalSubmissionRaw\": 9826, \"acRate\": \"58.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"6.2K\", \"totalSubmission\": \"10.5K\", \"totalAcceptedRaw\": 6159, \"totalSubmissionRaw\": 10536, \"acRate\": \"58.5%\"}",
|
||||
"hints": [
|
||||
"Count the number of times each target value follows the key in the array.",
|
||||
"Choose the target with the maximum count and return it."
|
||||
|
||||
Reference in New Issue
Block a user