Search
⌘K

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.

Comments

Your account is free and you can post anonymously if you choose.