route, a string of commands. Each command moves it one cell: 'N' north, 'S' south, 'E' east, 'W' west.
Return True if at some moment the robot stands on a cell it has already visited (the starting cell counts), and False if every cell on the route is new.route="NNEESW" → False
The robot visits (0,1), (0,2), (1,2), (2,2), (2,1), (1,1) — all different.
route="ENWS" → True
Four steps around a square bring the robot back to its start (0,0).
route="WE" → True
route="NNEESW"
False
Run checks the first 3 tests in your browser. Submit checks all 187 tests on the server, hidden ones included.