🚀Day 10. Minimum cost to connect all houses in a city 🧠
💡 Problem Description:
🔍 Example Walkthrough:
Example 1:
Input:
n = 5
houses[][] = [[0, 7], [0, 9], [20, 7], [30, 7], [40, 70]]Output:
105Explanation:
Example 2:
Input:
Output:
Explanation:
Constraints:
🎯 My Approach:
Optimized Prim’s Algorithm
🕒 Time and Auxiliary Space Complexity
📝 Solution Code
Code (C++)
Code (Java)
Code (Python)
🎯 Contribution and Support:
📍Visitor Count
Last updated