Wrong answer in Treasure Hunt


Please have a look over my code


I have modified the code but still it is not passing one test case!
All other test cases are being passed!!

Done!
All test case passed!
β€”To this point I would like to say, debugging myself help me to learn better!.

I have marked this doubt as resolved!!