Back to problems

Find a Lexicographically Optimal Robot Path with Charging Cells

Algorithm · Uber · Hard

A robot navigates an m x n matrix called grid. Each cell is one of three types: 0: open floor 1: blocked cell 2: automatic charging station The robot begins at the top-left cell (0, 0) and must reach the bottom-right cell (m - 1, n - 1). It may move up, down, left, or right into any adjacent cell that is not blocked. Every move consumes exactly one battery unit. The robot starts with a full battery of capacity C, and whenever it moves into a charging station, its battery is…

Checking your access…