What to print if there is cycle in the directed cyclic graph in this question . Please explain?

what to print if there is cycle in the directed cyclic graph in this question . Please explain?

Hello @anand_54 could you please explain what exactly you are asking i am unable to understand?

Basically in this question we are printing the topological ording of vertices but what if topological ordering doesn’t exist ? There may be cycle then what we have to print

@anand_54 i dont think you will face such issue.
as this question i s based on topological sort and topological sport can only be performed on DAG.