carloscn / carloscn/structstudy
数组中次数出现超过一半的数字(摩尔投票法)
Open
数组
查找
- Dominant language
- C
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
### 题目描述
数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字。
例如:输入一个长度为9的数组{1,2,3,**2,2,2**,5,4,**2**}。由于**数字2在数组中出现了5次**,超过数组长度的一半,因此输出2。如果不存在则输出0。
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.