Minimize the Maximum Cell on a Grid Path

Asked at Google · Coding Questions · Difficulty: Hard · Last asked Jan 19, 2026

You are given a rectangular grid of non-negative integers and two cells, `start` and `end`. You may move between cells that share an edge (up, down, left, right). The cost of a path is the **largest** cell value on it, including both endpoints; it is not the sum. Find the smallest possible cost over all paths from `start` to `end`, that is, the lowest ceiling that some path can stay under.

Loading the problem…