Solve interval merge and string dedup problems | Grammarly Interview Question