Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Why am I so resistant to using for loops on checkio? solution in Creative category for Duplicate Zeros by sedm0784
from collections.abc import Iterable
from itertools import chain
def duplicate_zeros(donuts: list[int]) -> Iterable[int]:
return chain.from_iterable([d] if d else [d, d] for d in donuts)
Feb. 16, 2023