Pregunta de entrevista de DoorDash

DFS Graph Question Question similar to 2 Sum