Sonatus interview question

Something similar to leet code merge interval problem.