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