Skip to content

Commit

Permalink
update merge_intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
yunshuipiao committed Feb 1, 2018
1 parent 63ebe78 commit b253245
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion array/merge_intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def merge_intervals(l):
out = [l.pop(0)]
for i in l:
if out[-1][-1] >= i[0]:
out[-1][-1] = i[-1]
out[-1][-1] = max(out[-1][-1], i[-1])
else:
out.append(i)
return out
Expand Down

0 comments on commit b253245

Please sign in to comment.