It gives me run error on submission

code runs smoothly for sample test case but on submission gives Run error

this is my code

@vishal23rfx

  1. See the constraints, value of x,y can be upto 2000. so ids[x1][y1] will give runtime error for x1, y1 >1000. So either increase size of your id array or use map.
  2. line 71 should be cost = min(cost,time[mp(i,j)]);

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.