Manhattan Meeting Place
Premium Content - Free Preview
You decided to add a new feature to your app. Given the locations of different people, the app will find the best place for them to meet so as to minimize the total travel time of all the parties.
Format
In each case, you will be given all the co-ordinates in a single Array:
{x1 y1 x2 y2... ...xn yn}
where each person n is located at position {xn, yn}. Calculate and print the best intersection to meet on a map.
End of Free Content Preview. Please Sign in or Sign up to buy premium content.
Comments
https://www.learneroo.com/modules/49/nodes/293
Can anyone help me understand what I am doing wrong? I took the approach of saving the x and y values to their own arrays, and then iterating through
until I found the coordinates. I match up with the first set of Correct Output, but not the second or third.
Learneroo
Jun 7, 11:41 PMSee this post for an explanation of an optimal solution.
thales
Jul 20, 2:25 PMHoly Cr*** this was hard!
a solution:
my code
thales
Jul 20, 2:28 PMIs there a solution ( not explanation) that i can see. I got a solution but if this is a good one i really dont know. I want to know if there is a better way?