https://ide.codingblocks.com/s/97704 Please check. The second hidden test case did not work.
Bfs test case issue
your code is not producing correct output when the input values range around like 5000-6000.
you need to check your logic.
if nothing helps you can ask again anytime
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.