Run time error what to do


i m getting runtime error in this code

hi @ArshjitSingh, these are some errors that i found in your code:

  1. you are not removing elements from the set i.e. you have to do s.remove§
  2. at line 39 you have if(it!=s.end()); remove the semi colon
  3. if node cannot be visited than you have to print -1
    4)add endl after printing all distances for every test case

here , i have made the needed changes:-


In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if no further queries

now also getting error in code

have u checked the code i have shared, i already made the changes in your 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.