0169. 多数元素 #35
utterances-bot
started this conversation in
Comments
Replies: 2 comments 3 replies
-
max = 0
max_index = -1
for num in numDict:
if numDict[num] > max:
max = numDict[num]
max_index = num
return max_index not working when nums all smaller than 0, just use |
Beta Was this translation helpful? Give feedback.
0 replies
-
已更新初始化 max 为 float('-inf') |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
0169. 多数元素 | 算法通关手册
https://algo.itcharge.cn/Solutions/0100-0199/majority-element/
Beta Was this translation helpful? Give feedback.
All reactions