Problem Statement:
A Vehicle (initially facing towards NORTH) travelled according to the direction moves got from the input. Find the direction in which the vehicle is facing at the end of the journey.
List of the Directions: NORTH / EAST / WEST / SOUTHPossible moves from input: STRAIGHT / LEFT / RIGHT / BACK
Problem Statement: A Vehicle (initially facing towards
NORTH
) travelled according to the direction moves got from the input. Find the direction in which the vehicle is facing at the end of the journey.List of the Directions:
NORTH
/EAST
/WEST
/SOUTH
Possible moves from input:STRAIGHT
/LEFT
/RIGHT
/BACK
Sample Input
Sample Output
SOUTH
Explanation Direction of facing after each step from the moves will go as follows
Rules