Tap here to switch tabs
Problem
Submissions

Problem: Element Appearing More Than 25% In Sorted Array

Element Appearing More Than 25% In Sorted Array gives you a sorted array with one unique value occurring more than a quarter of all elements. Return that value.

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

Element Appearing More Than 25% In Sorted Array gives you a sorted array with one unique value occurring more than a quarter of all elements. Return that value.

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