Problem 1595 · Hard

Minimum Cost to Connect Two Groups of Points

Track which second-group points already have an edge with a bitmask, then pay the cheapest edge for each point still uncovered.

Open the interactive visualisation