Walking Robot Simulation
Latest problem from Leetcode is this one: https://leetcode.com/problems/walking-robot-simulation/description/ Now the description of the problem doesn’t seem super accurate since in reality what the author is asking is: as the robot walks, for each step there will be an Euclidean distance from that position to the origin. Return the maximum Euclidean distance to the origin as the robot walks the course . Also, it wasn’t clear that one could have duplicated obstacle. I want to believe that many Leetcoders must have been confused and that might be the reason that there are more thumb downs than ups. I failed submission few times because of these misunderstandings: The problem is a simple traversal (some attention to details required) with usage of a hash table for a quick lookup into the obstacles. To quickly access the hash table, use the following trick to build the key: suppose that you want to build a key for index (a,b) with the following constraints: 0<=a<=N ...