Company: SDET_12oct
Difficulty: medium
Taru and Directions Problem Description Given a string consisting of instructions in the form of characters N, E, W, and S, denoting North, East, West, and South. In one move Taru can follow an order which Tan has given. An order is defined as a single character denoting that Taru has to move in that direction. Tan has given Taru a set of instructions in the form of a string. Since the number of instructions can be large Taru decided to skip all irrelevant steps. Irrelevant steps can be defined as EW (as going in the east and again in the west doesn't make any change in overall position). Similarly, there are many more instructions like these. You have to help Taru in removing all those irrelevant instructions. Note: You can remove instructions that are on the same axis. N and S are on the same axis and E and W are on the same axis so that Tan could not know that Taru has skipped some instructions. N and S will only be removed if they are consecutive and same for EW or WE. After each r