Please help me fix my code for ROBOTG

@vijju123 So, I saw what you changed. Doesn’t make any sense to me. I am already doing calculations for max inside the loop. Doing them again makes it redundant, I think. I kept the last bit outside the loop because there were no comparisons in the end

In that case dear, here is the test case input 10003 6DDLRURLRD8 8LLU10 1R3 2RUDU6 10ULRRLLUDUL5 1DLDUD - Pastebin.com and here is expected output safesafeunsafesafesafeunsafesafesafeunsafeunsafesafesafe - Pastebin.com Check that for which case your code fails, and see how loops etc. work. There must be some minor mistake, because shifting that calculation inside loop gave AC. Have a check! :slight_smile:

Thank you so much for that input. I checked mine against a correct one. It turns out that the mistake was a typo. After correcting the typo, I got AC. Thank you for helping me out!
Here’s the solution, if you want to see CodeChef: Practical coding for everyone

1 Like

I am glad it worked dear :slight_smile: