mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "小扣当前位于魔塔游戏第一层,共有 `N` 个房间,编号为 `0 ~ N-1`。每个房间的补血道具/怪物对于血量影响记于数组 `nums`,其中正数表示道具补血数值,即血量增加对应数值;负数表示怪物造成伤害值,即血量减少对应数值;`0` 表示房间对血量无影响。\n\n**小扣初始血量为 1,且无上限**。假定小扣原计划按房间编号升序访问所有房间补血/打怪,**为保证血量始终为正值**,小扣需对房间访问顺序进行调整,**每次仅能将一个怪物房间(负数的房间)调整至访问顺序末尾**。请返回小扣最少需要调整几次,才能顺利访问所有房间。若调整顺序也无法访问完全部房间,请返回 -1。\n\n\n**示例 1:**\n>输入:`nums = [100,100,100,-250,-60,-140,-50,-50,100,150]`\n>\n>输出:`1`\n>\n>解释:初始血量为 1。至少需要将 nums[3] 调整至访问顺序末尾以满足要求。\n\n**示例 2:**\n>输入:`nums = [-200,-300,400,0]`\n>\n>输出:`-1`\n>\n>解释:调整访问顺序也无法完成全部房间的访问。\n\n**提示:**\n- `1 <= nums.length <= 10^5`\n- `-10^5 <= nums[i] <= 10^5`",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 41,
|
||||
"likes": 44,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7K\", \"totalSubmission\": \"19.3K\", \"totalAcceptedRaw\": 7013, \"totalSubmissionRaw\": 19257, \"acRate\": \"36.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.4K\", \"totalSubmission\": \"20.1K\", \"totalAcceptedRaw\": 7408, \"totalSubmissionRaw\": 20061, \"acRate\": \"36.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user