Piyush and Magical Park

value of string is not changing, it is constant i.e 20 (which was passed while calling)

Hello @vipin.kumar,

Logically there are many issues in your program:

  1. Try to correct the input format.
    //To understand this better, print the array.

  2. You have not consider the following points:
    2.1. When there is no more strength left to move further
    2.2. When you go from last column o next row

I have corrected it for point 2:

Now, your task is correct it for point 1.

Hope, this would help.
Give a like if you are satisfied.

1 Like

corrected the input problem and now it is working fine. thank you.

@vipin.kumar anytime,

Please, mark it as resolved.

1 Like