mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>在《英雄联盟》的世界中,有一个叫 “提莫” 的英雄。他的攻击可以让敌方英雄艾希(编者注:寒冰射手)进入中毒状态。</p>\n\n<p>当提莫攻击艾希,艾希的中毒状态正好持续 <code>duration</code> 秒。</p>\n\n<p>正式地讲,提莫在 <code>t</code> 发起发起攻击意味着艾希在时间区间 <code>[t, t + duration - 1]</code>(含 <code>t</code> 和 <code>t + duration - 1</code>)处于中毒状态。如果提莫在中毒影响结束 <strong>前</strong> 再次攻击,中毒状态计时器将会 <strong>重置</strong> ,在新的攻击之后,中毒影响将会在 <code>duration</code> 秒后结束。</p>\n\n<p>给你一个 <strong>非递减</strong> 的整数数组 <code>timeSeries</code> ,其中 <code>timeSeries[i]</code> 表示提莫在 <code>timeSeries[i]</code> 秒时对艾希发起攻击,以及一个表示中毒持续时间的整数 <code>duration</code> 。</p>\n\n<p>返回艾希处于中毒状态的 <strong>总</strong> 秒数。</p>\n \n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>timeSeries = [1,4], duration = 2\n<strong>输出:</strong>4\n<strong>解释:</strong>提莫攻击对艾希的影响如下:\n- 第 1 秒,提莫攻击艾希并使其立即中毒。中毒状态会维持 2 秒,即第 1 秒和第 2 秒。\n- 第 4 秒,提莫再次攻击艾希,艾希中毒状态又持续 2 秒,即第 4 秒和第 5 秒。\n艾希在第 1、2、4、5 秒处于中毒状态,所以总中毒秒数是 4 。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>timeSeries = [1,2], duration = 2\n<strong>输出:</strong>3\n<strong>解释:</strong>提莫攻击对艾希的影响如下:\n- 第 1 秒,提莫攻击艾希并使其立即中毒。中毒状态会维持 2 秒,即第 1 秒和第 2 秒。\n- 第 2 秒,提莫再次攻击艾希,并重置中毒计时器,艾希中毒状态需要持续 2 秒,即第 2 秒和第 3 秒。\n艾希在第 1、2、3 秒处于中毒状态,所以总中毒秒数是 3 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= timeSeries.length <= 10<sup>4</sup></code></li>\n\t<li><code>0 <= timeSeries[i], duration <= 10<sup>7</sup></code></li>\n\t<li><code>timeSeries</code> 按 <strong>非递减</strong> 顺序排列</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 295,
|
||||
"likes": 298,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Merge Intervals\", \"titleSlug\": \"merge-intervals\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u5408\\u5e76\\u533a\\u95f4\"}, {\"title\": \"Can Place Flowers\", \"titleSlug\": \"can-place-flowers\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u79cd\\u82b1\\u95ee\\u9898\"}, {\"title\": \"Dota2 Senate\", \"titleSlug\": \"dota2-senate\", \"difficulty\": \"Medium\", \"translatedTitle\": \"Dota2 \\u53c2\\u8bae\\u9662\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"70.8K\", \"totalSubmission\": \"117.3K\", \"totalAcceptedRaw\": 70844, \"totalSubmissionRaw\": 117317, \"acRate\": \"60.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"72.5K\", \"totalSubmission\": \"120.1K\", \"totalAcceptedRaw\": 72462, \"totalSubmissionRaw\": 120075, \"acRate\": \"60.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user