Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
if data[i%len(data)] - data[i-1] != 1 solution in Clear category for Create Intervals by Olpag
def create_intervals(data):
data = sorted(data)
k, lst = 0, []
for i in range(1, len(data)+1):
if data[i%len(data)] - data[i-1] != 1:
lst += [(data[k], data[i-1])]
k = i
return lst
Feb. 26, 2019
Comments: