Amazon interview question

Merge Intervals Problem from LeetCode