Pinterest Interview Question

Medium level leetcode question, overlapping intervals