LiveRamp interview question

Leetcode question that involved BFS/DFS