Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
simple loop solution in Clear category for Create Intervals by mplichta
def create_intervals(data):
plus_one, minus_one = [], []
for d in sorted(data):
if d - 1 not in data:
minus_one.append(d)
if d + 1 not in data:
plus_one.append(d)
return list(zip(minus_one, plus_one))
Nov. 16, 2017
Comments: