DoorDash Interview Question

Topological sort question - just study topological sort.