Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Yield solution in Speedy category for Duplicate Zeros by CedricVaruna
from typing import Iterable
def duplicate_zeros(donuts: list[int]) -> Iterable[int]:
for v in donuts:
if v == 0:
yield 0
yield v
return []
Nov. 21, 2022
Comments: