Grubhub Interview Question

similar to merge intervals @ leetcode