Back to problems

Delivery-Center Grid — Minimum Inconvenience

Algorithm · Amazon · Medium

Minimize the Maximum Distance to a Service Station After Adding One Hard · Topics · Company Tags · Hints You are given an n by m grid of integers. Each cell is either 0 (an empty lot) or 1 (a service station). The distance between two cells (r1, c1) and (r2, c2) is defined as max( r1 - r2 , c1 - c2 ) — this is the Chebyshev distance, just like the movements of a king on a chessboard. For every empty lot, we consider the distance to the nearest existing service station. The…

Checking your access…