DoorDash Interview Question

Some variations Of DFS algorithm