Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
first, *data = sorted(data) solution in Clear category for Create Intervals (generator version) by flpo
def create_intervals(data):
if not data: return
first, *data = sorted(data)
last = first
for current in data:
if last + 1 < current:
yield first, last
first = current
last = current
yield first, last
Sept. 3, 2018