Algorithm · Uber · Hard
Problem Overview You are given N rider coordinates and must select K shuttle pickup points. The goal is to minimize the sum of the Manhattan distances from every rider to their closest pickup point. For points (x1, y1) and (x2, y2), Manhattan distance is defined as: This is the two-dimensional k-median problem under the L1 metric. Your task is to describe a practical algorithm for choosing the pickup locations and explain its performance and limitations. Example 1 Input:…
Checking your access…