Python Topological Sort Geeksforgeeks