Pergunta de entrevista da empresa Snap

leetcode 212 hard problem. They expect QA engineers to solve this in 25 min.