mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-11-19 22:23:46 +00:00
Update 39. 数组中出现次数超过一半的数字.md
说明力扣和牛客的版本都保证存在这样的数。
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
例如 [3, 1, 3, 2, 3]:3 与 1 抵消,3 与 2 抵消,最后剩下的 3 就是答案。
|
||||
|
||||
第二次遍历统计候选的出现次数,用于题目不保证存在这样的数时(牛客的版本不存在时返回 0);力扣的版本保证存在,可以省略。
|
||||
第二次遍历统计候选的出现次数,用于题目不保证存在这样的数时,例如要求不存在时返回 0;力扣和牛客的版本都保证存在,可以省略。
|
||||
|
||||
```java
|
||||
public int inventoryManagement(int[] stock) {
|
||||
|
||||
Reference in New Issue
Block a user