its giving right answer on dry run
Please tell me why its not passing any of the test case
hello @KetanPandey
u missed one very important condition.
that is to avoid loop.(yeah loop)
becaue now rat can move in all four direction it might happen that we visit same sate again n agin.
to avoid it check whether u have already visited ur current state or not. if it is visited (thats means u r running in a loop) . so return false to avoid loop.
consider this
from (i,j),
move down by 1
then move right by 1
then move up by 1
and then move left by 1.
after these moves u will again reach to same state.
now if u again proceed from that state then u will again take these same steps and this will keep happening again n again . and u will stuck in an infinite loop.
i think i have already made this condition because ispossible function will not return true in such case
i have modified some parts of program and now its passing three test cases.Please correct the code so that it passes all the test cases
please share ur updated code using cb ide
i have passed the link in above comment.Please correct the same program and wxplain with the help of comments
hey i am waiting since two days,u have not corrected my code.U people promise to reply in 24 hours
hey i think i have already explained u what is missing in ur code.
the code u have sent is somewhat similar to previou code only.
pls refer this code->
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.