Distance from every desk to its nearest bathroom
An office floor plan is a grid of bathrooms, desks and open floor. For every desk, return how many steps (up, down, left, right) it takes to reach the closest bathroom. Expect follow-ups on a one-dimensional version, pairing desks with bathrooms globally, and floor plans that arrive row by row.
No answer yet. Write the first one; the best answer gets endorsed.
