Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in 3rd party category for Median of Three by vit.aborigen
from typing import Iterable
from numpy import median
def median_three(els: Iterable[int]) -> Iterable[int]:
return els[:2] + [int(median(els[i - 3 : i])) for i in range(3, len(els) + 1)]
Dec. 13, 2018