Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
accumulate commands solution in Clear category for Scarecrow Robot by juestr
from itertools import accumulate
def visits(stations: int, control: int, commands: list[int]) -> int:
control -= 1
return sum(s % stations == control for s in accumulate(commands, initial=0))
Aug. 18, 2024