A grid of open cells and walls, and Q queries asking whether one cell can reach another. Go from one search per query to a single pass that answers every query in O(1). A Flexport SDE-1 problem-solving round.
A grid of open cells and walls, and Q queries asking whether one cell can reach another. Go from one search per query to a single pass that answers every query in O(1). A Flexport SDE-1 problem-solving round.
Opens with the full question.