Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by twilyght
from typing import List
def checkio(data: List[int]) -> [int, float]:
sorted_data = sorted(data)
count = len(data)
mid = count // 2
return sorted_data[mid] if count % 2 else (sorted_data[mid - 1] + sorted_data[mid]) / 2
May 4, 2020