Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Generator solution in Clear category for Duplicate Zeros by belokr
from collections.abc import Iterable
def duplicate_zeros(donuts: list[int]) -> Iterable[int]:
for d in donuts:
yield d
if d == 0: yield 0
Jan. 26, 2023
Comments: