Pregunta de entrevista de Microchip Technology

Medium leetcode question, merge intervals