Search
⌘K
Get Premium
Leetcode 1057. Campus Bikes
Given positions of workers and bikes on a 2D grid, assign each worker a distinct bike to minimize the total Manhattan distance (return the bike index for each worker). This is a minimum-cost bipartite matching problem that can be approached by ordering worker–bike pairs by distance (with tie-breakers on indices) and greedily assigning, or solved more generally with matching/flow algorithms.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.