Maze Robot Distance
You are given a 2D maze represented by a matrix maze consisting of the following characters:
'O' represents the position of a robot.
'X' represents a blocker (obstacle).
'E' represents an empty cell.
You are also given an integer array distance of length 4, where distance[0], distance[1], distance[2], and distance[3] represent the desired distance from the robot to the nearest blocker in the left, right, top, and bottom directions, respectively.
Return an array of coordinates (row, column) representing the positions of the robots that have the provided distance to the nearest blocker in all four directions.
Example:
maze = [
['O', 'E', 'E'],
['X', 'E', 'E'],
['E', 'E', 'O']
], distance = [1, 3, 1, 1]
Output: [[0, 0]]
Explanation: The robot at (0, 0) has a distance of 1 to the blocker on the right, 1 to the blocker on the top, and 1 to the blocker on the bottom. The robot at (2, 2) has a distance of 3 to the blocker on the left, but the required distance is 1, so it is not included in the answer.Comments (3)


