Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1135. Connecting Cities With Minimum Cost
Given n cities and a list of undirected weighted connections, find the minimum total cost to connect all cities (or return -1 if it's impossible). The core challenge is computing a minimum spanning tree (MST), typically solved with Kruskal/Prim and union-find to ensure full connectivity.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late May, 2025
Meta
Senior
Mid September, 2024
Meta
Senior
Given 2 arrays with costs between 2 cities (a -> b and b -> a), return the min round trip cost between 2 cities
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.