Citi Interview Question

lc 1, Merge intervals lc2. check if valid BFS