Write a Python script toposort.py that reads a dependency graph from stdin and outputs either a topological…
Write a Python script toposort.py that reads a dependency graph from stdin and outputs either a topological…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input format (stdin): One line per edge. Each line is exactly two non-empty strings separated by a single…
The task
**Input format (stdin):** One line per edge. Each line is exactly two non-empty strings separated by a single colon `:`. The first string is the predecessor, the second is the successor (meaning "A depends on B" or "B must come before A" — the edge is A→B). There are no spaces around the colon. Strings may contain…
Part of ai-and/termgrade-environments.