Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Expand Intervals by Pactp
from typing import Iterable
def expand_intervals(items: Iterable) -> Iterable:
yield from (n for a,b in items for n in range(a, b+1))
April 6, 2023