Amazon Interview Question

Topological Sort of Graph Question