← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a sorted integer array nums of length n, return all elements that appear more than ⌊n / 3⌋ times. Because the array is sorted, identical values are contiguous. There can be at most two such majority elements. You must solve the problem in O(log n) time and O(1) extra space.