Why the code is giving TLE?
I have edited your code… Try to submit it now…
1 Like
Thanks for the edit. Yes its working.
With or method I had submitted the code before successfully.
Can you tell me why was the return method not working? I wanted to reduce few comparisons, that’s why tried using return method.
Its because in the question its mentioned that you are required to print the rightmost path only… and thts why for large matrix, when u are trying to visit multiple paths… It wasnt keeping a record at tht time which is the rightmost path…as every time the matrix gets returned to its initial coordinates only… thus was giving TLE…