Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Create Intervals (generator version) by ssk8
def create_intervals(data):
while data:
current = current_next = min(data)
data.remove(current)
while True:
if current_next + 1 in data:
current_next += 1
data.remove(current_next)
else:
yield current, current_next
break
return []
April 3, 2019