Median O(1)
Start Timer
0:00:00
You’re given a list of sorted integers in which more than 50% of the list is comprised of the same repeating integer.
Write a function to return the median value of the list in computational time and space.
Note: the lists are all non-empty
Example:
Input:
li = [1,2,2]
Output:
median(li) -> 2
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments