Catterpillar | PostMan | Interview Question

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2020-07-04Added By Anonymous
Source: Link

Catterpillar can move in a given directions by leaving the given traces.


Direction Traces

N , S ===== |

E , W ==== _

NE, SW ===== \

NW , SE ===== /

Return the Character grid


Input :

Given number than space followed by direction

string "x" will be the terminating string


Example:

3 SE

3 SW

4 E

x


Ouput:

|\

| space\

| space space \

| space space /

| space /

| /

| _ _ _ _ x


Note : space = " "

Comments