Question d’entretien chez Amazon

Question on leetcode (merge intervals)