Practice Element Appearing More Than 25% In Sorted Array
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer.
Source: Element Appearing More Than 25% In Sorted Array on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
arr = [1,2,2,6,6,6,6,7,10]
Output
6
# Example 2
Input
arr = [1,1]
Output
1
Constraints
1 <= arr.length <= 10^4
0 <= arr[i] <= 10^5
Related LeetCode Problems
Practice more problems similar to Element Appearing More Than 25% In Sorted Array.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.