Amazon interview question

Coding question about merging intervals with a twist.