Algorithm · DoorDash · Easy
Given a pickup point pickup = (x, y) and zero or more dashers. Each dasher record has the form (id, x, y, is_available), where id is a unique integer, (x, y) is the dasher's current location, and is_available is a boolean indicating whether that dasher is eligible for the order. Restrict consideration to dashers whose is_available is true. Among those, choose the dasher with the smallest Euclidean distance from their current location to the pickup point. For a dasher at (xd,…
Checking your access…