Company: Dp World_28aug
Difficulty: medium
Metro Land Festival Problem Description Find the optimal location for a festival in Metro Land to minimize the total travel cost for all citizens. Metro Land is located on a 2D plane with cities at various coordinates. The travel cost for a person from a city at (x, y) to the festival at (a, b) is |x-a| + |y-b|. In the numPeople array, numPeople[i] is the number of people residing in city i . The festival can be held at any integral location. Find the location that minimizes the total travel cost for all citizens and return that minimum cost. Function Description Complete the function minimizeCost in the editor with the following parameter(s): int numPeople[n] : each numPeople[i] denotes the number of people in city i int x[n] : each x[i] denotes the x coordinate of city i int y[n] : each y[i] denotes the y coordinate of city i Returns int : the minimum cost of getting all the people to an optimal festival location. Examples Example 1: Given: numPeople = [1, 2] x = [1, 3] y = [1, 3] Th