Run error! ioougougiykkg

my code is in java why is it giving run error

@mayank10
It is no longer giving run time error
I think your query is resolved
Please close it

giving tle and one wrong answer to one of the input test case

@mayank10
I wasn’t able to understand your approach correctly but I’m sure it wasn’t correct since this question is based on BFS and your code is not about that as far as I can see
Please rethink your approach

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.