Manhattan Meeting Place
You're creating an app to replace Google Maps and are working on a new feature. Given the locations of different people, the app will find the best place for them to meet so as to minimize the total travel distance of all the parties. People can only travel on the roads.
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.
Example
If given the following input:
0 2 2 7 7 5
...Print 2 5
which would be the location with the minimum total travel distance.
Constraints
There can be up to 10,000 numbers of input with a range from -10,000 to 10,000.
Challenge
Print the co-ordinates of the meeting point that will minimize the total combined travel distance.
Please sign in or sign up to submit answers.
Alternatively, you can try out Learneroo before signing up.