UKG Interview Question

The DSA question was from Leetcode and was merging intervals.