1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 23:11:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 520,
"likes": 551,
"dislikes": 6,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Minimum Swaps to Group All 1's Together\", \"titleSlug\": \"minimum-swaps-to-group-all-1s-together\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"12.6K\", \"totalSubmission\": \"26.7K\", \"totalAcceptedRaw\": 12617, \"totalSubmissionRaw\": 26739, \"acRate\": \"47.2%\"}",
"stats": "{\"totalAccepted\": \"13.3K\", \"totalSubmission\": \"27.9K\", \"totalAcceptedRaw\": 13338, \"totalSubmissionRaw\": 27916, \"acRate\": \"47.8%\"}",
"hints": [
"Notice that the number of 1s to be grouped together is fixed. It is the number of 1's the whole array has.",
"Call this number total. We should then check for every subarray of size total (possibly wrapped around), how many swaps are required to have the subarray be all 1s.",