1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 23:41:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2023-12-09 19:57:46 +08:00
parent 9bc4722a45
commit 3770b44d1e
4792 changed files with 10889 additions and 10886 deletions

View File

@@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 210,
"likes": 211,
"dislikes": 10,
"isLiked": null,
"similarQuestions": "[]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"3K\", \"totalSubmission\": \"12.4K\", \"totalAcceptedRaw\": 2961, \"totalSubmissionRaw\": 12440, \"acRate\": \"23.8%\"}",
"stats": "{\"totalAccepted\": \"3K\", \"totalSubmission\": \"12.4K\", \"totalAcceptedRaw\": 2966, \"totalSubmissionRaw\": 12449, \"acRate\": \"23.8%\"}",
"hints": [
"<div class=\"_1l1MA\">It can be proven that in the optimal solution, for each index <code>i</code>, we only need to set <code>nums1[i]</code> to <code>0</code> at most once. (If we have to set it twice, we can simply remove the earlier set and all the operations “shift left” by <code>1</code>.)</div>",
"<div class=\"_1l1MA\">It can also be proven that if we select several indexes <code>i<sub>1</sub>, i<sub>2</sub>, ..., i<sub>k</sub></code> and set <code>nums1[i<sub>1</sub>], nums1[i<sub>2</sub>], ..., nums1[i<sub>k</sub>]</code> to <code>0</code>, its always optimal to set them in the order of <code>nums2[i<sub>1</sub>] <= nums2[i<sub>2</sub>] <= ... <= nums2[i<sub>k</sub>]</code> (the larger the increase is, the later we should set it to <code>0</code>).</div>",