Magical Park Question Implementation

Please tell the error in the code as the final strength is not coming correct.

I didn’t received your code. Please share it with me.

Ok. Here is the code :- https://ide.codingblocks.com/s/406024

Check now=>


Passing all test cases, and have commented what i have updated.

Is the question’s requirements is that if we encounter a # then the strength of taking one step won’t be reduced, because the position of if condition, where we are reducing strength by a factor of 1 is being changed only and this would affect only when the above condition will follow. Is that so? or there is some other reason?

You have to take char array instead you are taking int arrray, also you weren’t taking input correctly. Check the code i have provided to you. You will get to know the difference.

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.