Mubashir created a simple robot that is navigated by a series of North, East, South, and West [n, e, s, w] commands. Each command moves the robot one step in the given direction. The robot is designed for only two destinations:
Create a function that takes a list of commands and returns True if the robot reaches any of the destinations, False otherwise.
robot_path(["s", "e", "e", "n", "n", "e", "n"]) β True
# Robot will end up at destination no. 1
robot_path(["n", "e", "s", "w", "n", "e", "s", "w", "w", "s", "n", "e"]) β False
# Robot will be lost somewhere
robot_path(["n", "s", "n", "n", "e", "n", "w", "w", "s", "w", "w", "w", "n"]) β True
N/A