We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6af8c54 commit 82194fcCopy full SHA for 82194fc
leetcode/medium/056_merge_intervals.md
@@ -7,6 +7,8 @@
7
8
By sorting the intervals, we can then recreate the result by comparing previous intervals with the current interval from left to right.
9
In this way, we can check if the two intervals overlap each other after the sort.
10
+We can keep a temporary new interval that we compare to as we loop.
11
+When finding a non-overlapping interval, we can insert the new interval into the result and set the new interval as the current interval.
12
13
```
14
class Solution:
0 commit comments