Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by wbl4126
from typing import List
def checkio(data: List[int]) -> [int, float]:
data.sort()
ind = len(data) // 2
return data[ind] if len(data) % 2 == 1 else sum(data[ind-1:ind+1]) / 2
March 5, 2020