write a programme to reduce the string length
which is asked by sir in this video
Reduced string length
Hey @rakesh800650
Here is the pseudo code
H = 0
V = 0
for character C in String S :
if C == ‘N’ : V++;
if C == ‘S’ : V–;
if C == ‘E’ : H++;
if C == ‘W’ : H–;
Then print answer based on V,H
If V > 0 print N else S while V != 0 and similarly for H
If your doubt is resolved please mark it as closed.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.