Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Median by melitaele
from typing import List
def checkio(data: List[int]) -> [int, float]:
data = sorted(data)
if len(data) % 2 == 1:
return data[len(data) // 2]
else:
return (data[len(data) // 2 - 1] + data[len(data) // 2]) / 2
April 30, 2021