CapitalOne OA
Anonymous User
332

Question 1

  • You are given an m × n grid, the robot's starting position, and the coordinates of several laser emitters.

  • A laser emitter attacks every cell in the same row and column. Any attacked cell is unsafe.

  • The robot can move one step at a time in the four directions and cannot leave the grid.

  • Return the maximum number of safe cells that the robot can reach, including its starting cell. If the starting cell is under laser attack, return 0.

Example:-
m = 4
n = 4
startRow = 0
startCol = 0
lasers = [[1,2]]

Comments (3)