Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
zip, statistics.median solution in Clear category for Median of Three by twilyght
from statistics import median
from typing import Iterable
def median_three(els: Iterable[int]) -> Iterable[int]:
return els[:2] + [median(seq3) for seq3 in zip(els, els[1:], els[2:])]
May 4, 2020
Comments: