Walking Robot Simulation Maximum Distance Squared
Simulate robot movement on infinite 2D grid based on commands and obstacles to find max Euclidean distance squared from origin.
874. Walking Robot Simulation Difficulty: Medium Topics: Array, Hash Table, Simulation A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot can receive a sequence of these three possible types of commands: -2: Turn left 90 degrees. -1: Turn right 90 degrees. 1 <= k <= 9: Move forward k units, one unit at a time. Some of the grid squares are obstacles. The ith obstacle is at grid point obstacles[i] = (xi, yi). If the robot runs into an obstacle, then it will instead stay in its current location and move on to the next command. Return _the maximum Euclidean distance t...
