Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
double updown - no imports solution in Clear category for Changing direction by juestr
def changing_direction(elements: list) -> int:
cmp = lambda a, b: (a > b) - (a < b)
updown = lambda xs: list(filter(None, map(cmp, xs, xs[1:])))
return len(updown(updown(elements)))
Aug. 20, 2022
Comments: