Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Median solution in Clear category for Median by jcrljenko
def checkio(data):
new_data = sorted(data)
length = len(new_data)
middle = length / 2
if length % 2:
return new_data[middle]
return sum(new_data[middle - 1 : middle + 1]) / 2.0
Oct. 8, 2015