Problem 1584 · Medium

Min Cost to Connect All Points

Connect points into a minimum-cost tree by adding the cheapest Manhattan-distance edges first. The visual grows the spanning tree one edge at a time.

Open the interactive visualisation