← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given an m x n board representing a position map and an array distance of four integers.
Each cell of the board is one of:
"O" for a robot"E" for an empty space"X" for a blocker
The board boundary is also considered a blocker.
The distance array is ordered as [left, top, bottom, right], where each value is the distance from a robot to the closest blocker in that direction.
Return the coordinates of all robots whose distances exactly match the query. The output order does not matter.Only the robot at (1, 1) has blocker distances of 2 to the left, 2 to the top, 4 to the bottom, and 1 to the right.