Topological Ordering of a Directed Graph

The post identifies this problem only as topological sorting. The following is a standardized formulation; the input format, constraints, and cycle behavior are supplementary assumptions rather than...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: