1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 08:21: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

@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"20.8K\", \"totalSubmission\": \"33.7K\", \"totalAcceptedRaw\": 20752, \"totalSubmissionRaw\": 33673, \"acRate\": \"61.6%\"}",
"stats": "{\"totalAccepted\": \"20.8K\", \"totalSubmission\": \"33.7K\", \"totalAcceptedRaw\": 20757, \"totalSubmissionRaw\": 33681, \"acRate\": \"61.6%\"}",
"hints": [
"Find the dominant element of nums by using a hashmap to maintain element frequency, we denote the dominant element as x and its frequency as f.",
"For each index in [0, n - 2], calculate f1, xs frequency in the subarray [0, i] when looping the index. And f2, xs frequency in the subarray [i + 1, n - 1] which is equal to f - f1. Then we can check whether x is dominant in both subarrays."