Microchip Technology Interview Question

Medium leetcode question, merge intervals