Back to problems

Laser Grid Robot Max Safe Run

Algorithm · Capital One · Medium

Requirements The inputs are numRows, numColumns, curRow, curColumn, and laserCoordinates. Every entry in laserCoordinates has the form [row, column]; its laser makes all cells in that row and all cells in that column unsafe. The robot begins at (curRow, curColumn). Its starting square remains safe even when its row or column is hit by a laser, and a laser cannot be placed on that starting square. The robot selects exactly one cardinal direction—left, right, up, or down—and…

Checking your access…