DoorDash interview question

DFS Graph Question Question similar to 2 Sum