Implement Prototype(costs [][]*int) (*int,error) by converting the upper triangle to edges and using an MST method; Solve uses array-frontier Prim in O(V²) time and O(V) auxiliary memory. Matrix must be square and symmetric in optional values; validate before ignoring diagonal. nil means absent; zero/negative real costs valid. Return nil disconnected, pointer zero for empty graph. Shape/asymmetry return error. Preserve all rows and pointed-to values.

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.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.