Tap here to switch tabs
Problem
Submissions

Problem: Element Appearing More Than 25% In Sorted Array

Try to solve the Element Appearing More Than 25% In Sorted Array problem.

Statement

Given an integer array arr sorted in non decreasing order, there is exactly one integer in the array that occurs more than 2525\\% of the total number of elements.

Return that integer.

Constraints:

  • 1≤1 \leq arr.length ≤104\leq 10^4

  • 0≤0 \leq arr[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Element Appearing More Than 25% In Sorted Array

Try to solve the Element Appearing More Than 25% In Sorted Array problem.

Statement

Given an integer array arr sorted in non decreasing order, there is exactly one integer in the array that occurs more than 2525\\% of the total number of elements.

Return that integer.

Constraints:

  • 1≤1 \leq arr.length ≤104\leq 10^4

  • 0≤0 \leq arr[i] ≤105\leq 10^5