Pergunta de entrevista da empresa fabric

Merge intervals LC medium given 2 D array ask you to merge the overlapped part