HF RL Explorer

Create a command-line tool /app/topsort that reads a dependency file and outputs a valid topological…

Create a command-line tool /app/topsort that reads a dependency file and outputs a valid topological…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input format (stdin or file argument): Each line is a dependency rule: A - B means "A depends on B" (B must appear…

The task

**Input format (stdin or file argument):** Each line is a dependency rule: `A -> B` means "A depends on B" (B must appear before A in the output). Rules are separated by newlines. A line may have optional whitespace around `->`. Empty lines are ignored. Comment lines start with `#` and are ignored.

Part of ai-and/termgrade-environments.