Round 1
Questions: An energy company needs a control center to manage a distributed wind farm. Due to terrain and other considerations, the cost to reach a group of windmills is specific to each location. Locate the control center to minimize the cost. Return the minimum cost.
-
The control center is located at integral coordinates (cx, cy).
-
Wind farm i is located at integral coordinates (x[i], y[i]).
-
The distance farm i is the Manhattan distance, i.e., distance[i] = |x[i] - cx| + |y[i] - cy|
-
The cost to connect farm i is premium[i] × distance[i]
-
The total cost to connect all farms to the control center is the sum of the cost to connect each farm.
Determine the minimum cost to connect to the control center.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.