调试中...
调试中...
题目描述
题目描述
题解
题解
提交记录
提交记录
代码
代码
测试用例
测试用例
测试结果
测试结果
简单
相关标签
相关企业
提示

给你一个非递减的 有序 整数数组,已知这个数组中恰好有一个整数,它的出现次数超过数组元素总数的 25%。

请你找到并返回这个整数

 

示例:

输入:arr = [1,2,2,6,6,6,6,7,10]
输出:6

 

提示:

  • 1 <= arr.length <= 10^4
  • 0 <= arr[i] <= 10^5
通过次数
51.1K
提交次数
86.9K
通过率
58.8%

相关标签

相关企业

提示 1
Divide the array in four parts [1 - 25%] [25 - 50 %] [50 - 75 %] [75% - 100%]

提示 2
The answer should be in one of the ends of the intervals.

提示 3
In order to check which is element is the answer we can count the frequency with binarySearch.

评论 (0)

贡献者
© 2025 领扣网络(上海)有限公司
0 人在线
行 1,列 1
运行和提交代码需要登录
arr =
[1,2,2,6,6,6,6,7,10]
Source