Ad
  • Custom User Avatar

    not sure if my way is fully correct, but it worked for most of the tests. so basically, i kept count of every "n", "e", "w", and "s" direction. then, i checked if the number of occurences for "n" and "s" were the same, since they are opposite of each other. then, i did the same for "e" and "w" as well. if the occurences are the same, the directions take you back to the starting point. hope this helped!