Algorithm · Uber · Medium
You are given an m × n position map and a four-element array describing the distances from a robot to the nearest blocker in each cardinal direction. Each board cell has one of these meanings: O: a robot. E: an unoccupied cell. X: a blocker. Treat the outer edge of the board as a blocker as well. The four entries in the distance array are ordered as left, top, bottom, and right. Implement a function that receives the position map and the distance array, then returns the…
Checking your access…