Implement Prototype(n int,edges [][2]int) ([]int,error) by lexicographic permutations; Solve uses indegrees and smallest-first legal frontier. Deduplicate directed edges. Return lexicographically smallest complete ordering, nil on cycle, nonnil empty for n=0. Negative n or invalid endpoints returns error. Preserve edges; cycles are an ordinary nil result rather than an error.
Edit exercise.go; retain the public types and signatures. prototype and final are separate stages. The executable tests recover panics as failures, report named checks, and exit nonzero on any failure. A successful run must execute at least one check. Tests use logical time or explicit synchronization where relevant.
Complete the starter code, then run the checks.
Results and errors will appear here.