Reddit is opening an offline kiosk in a city that is a perfect grid. Given the locations of all customers as grid intersections, return the best place to put the kiosk (any optimal location).
Asked in the phone screen stage for an Android developer phone interview; examples were given with 5 customer points.
Implement def best_kiosk_location(customers):. customers is a non-empty list of [x, y] integer coordinates. Return an [x, y] grid intersection minimizing the sum of Manhattan distances to all customers. Any optimal location is accepted.
def best_kiosk_location(customers):