HF RL Explorer

Write a command-line tool that performs topological sorting on a directed graph with cycle detection.

Write a command-line tool that performs topological sorting on a directed graph with cycle detection.: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input format (stdin): - One edge per line, format: A - B - Node names are arbitrary non-empty strings that may…

The task

**Input format (stdin):** - One edge per line, format: `A -> B` - Node names are arbitrary non-empty strings that may contain spaces, Unicode characters, and special characters except `->` - Lines may have leading/trailing whitespace - Empty lines must be ignored - Lines starting with `#` are comments and must be…

Part of ai-and/termgrade-environments.