Exotel interview question

Merge the intervals medium level