Pergunta de entrevista da empresa LiveRamp

Leetcode question that involved BFS/DFS