← back to unit
Medium
# sorting medium
The Middle Kid
The seesaw referee must be the middle-est kid: as many kids lighter than them as heavier. ⚖️
You get an ODD number of weights. Print the middle value after sorting — the median!
Example:
Input: weights = [30, 10, 20]
Output: 20
Sorted, the list becomes [10, 20, 30] — the middle position holds 20, the median.
💡 need a hint?
sort-middle-kid.py🔒 given lines are locked — write your code in between
loading...