Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
4-liner: no title solution in Clear category for Merge Intervals by przemyslaw.daniel
def merge_intervals(data):
result = sorted(set(sum([list(range(x, y+1)) for x, y in data], [])))
result = [x for x in result for k in [-1, 1] if x+k not in result]
return list(zip(result[0::2], result[1::2]))
July 28, 2017
Comments: