3
// N--> left(-2):W, right(-1):E4
// S--> left:E, right:W5
// E--> left:N, right:S6
// W--> left:S, right:N8
vector<vector<int>> change = { // for direction change14
vector<vector<int>> sign = {15
// signs for x and y coordinates movement22
int robotSim(vector<int> &commands, vector<vector<int>> &obstacles) {24
for (int i = 0; i < obstacles.size(); i++) {25
s.insert(obstacles[i]);30
for (int i = 0; i < commands.size(); i++) {31
if (commands[i] <= 9 && commands[i] >= 1) {32
int signx = sign[direction][0];33
int signy = sign[direction][1];37
if (s.count({xi, yi})) {45
direction = change[direction][commands[i] + 2];47
ans = max(ans, xi * xi + yi * yi);