dsa8 min read
Minimum Cost to Connect All Points — Prim's MST on a Complete Graph [LC 1584, Amazon, Google]
Master LeetCode 1584 Min Cost to Connect All Points: model the n^2 implicit edges as a complete graph, then run Prim's MST in O(n^2) without ever materialising the edge list. A FAANG-favourite interview question at Amazon, Google, and Meta that tests whether you can spot a Minimum Spanning Tree behind a geometry prompt.
Read →