A robot starts on an infinite commands, representing a sequence of actions:
There are obstacles on the grid, provided in an array obstacles where each element obstacles[i]
Return the maximum squared Euclidean distance from the origin that the robot reaches at any point along its path.
Note: The squared Euclidean distance of a position
from the origin is defined as .
Constraints:
commands.length
commands[i] is either
obstacles.length
The answer is guaranteed to be less than
A robot starts on an infinite commands, representing a sequence of actions:
There are obstacles on the grid, provided in an array obstacles where each element obstacles[i]
Return the maximum squared Euclidean distance from the origin that the robot reaches at any point along its path.
Note: The squared Euclidean distance of a position
from the origin is defined as .
Constraints:
commands.length
commands[i] is either
obstacles.length
The answer is guaranteed to be less than