Given a collection of intervals, merge all overlapping intervals.
Example 1:
Input: [[2,6],[8,10],[15,18], [1,3]]
Output: [ [1,6] , [8,10] , [15,18] ]
Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
![](https://i0.wp.com/www.gohired.in/wp-content/uploads/2019/12/examp1.png?fit=1024%2C236&ssl=1)
![](https://i0.wp.com/www.gohired.in/wp-content/uploads/2019/12/exam1-sol.png?fit=1024%2C152&ssl=1)
Interview Questions asked in Google, Microsoft, Amazon