The Merge Intervals pattern is an efficient technique to deal with overlapping intervals. In a lot of problems involving intervals, you either need to find overlapping intervals or merge intervals if they overlap. There are some cases where you shouldn't use the Two Pointer approach such as in a singly linked list where you can’t move in a backwards direction.
Table of contents
@ fahimulhaq Fahim ul Haq3 Comments
Sort: