Question: Imagine you have a map displaying various cities represented by coordinates on a 2 D - plane, with each pair ( xi , yi )
Imagine you have a map displaying various cities represented by coordinates
on a Dplane, with each pair xi yi in an array points indicating the location of a city. You are planning to establish flight routes between these cities.
The fuel required to set up a flight route between any two cities depends on their respective positions on the map.Return the minimum fuel required to connect all locations on the map. All locations are connected if there is exactly one simple path between any two locations.
Constraints:
points.length
xi
yi
All pairs xi yi are distinct.
Input :
locations
Output :
Explanation:
We can connect the points as shown above to get the minimum cost of
Input :
locations
Output :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
