Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
O(1) space generator solution in Creative category for Replace First by StefanPochmann
def replace_first(items):
it = iter(items)
for first in it:
yield from it
yield first
April 4, 2024