Amazon Interview Question

algorithm topology sort in graph