Ad
  • Custom User Avatar

    Try to visualize the task in a cartesian coordinate system: (0,0) -> (1,0) -> (0,0) -> (-1,0) -> (-1,1) -> (-1,0) -> (0,0) -> (0,-1)

    arr[0]+arr[1] eliminate each other, then arr[3]+arr[4], resulting in South (arr[2]) and North (arr [5]) being next to each other, thus annihilating each other, which means that arr[6] "West" is the only entry, which doesn't cancel anything out in our given array.