I have followed exactly the video approach and also checked that sample test cases are working but on submitting it shows 0/100. Please help.
Sample Test cases passed but submission shows 0/100
@pd.pankajdahiya why you are making this:
unordered_map<int,vector<vector>> m;
i think your logic is wrong here:
your code is giving error for other test cases:
your logic is correct just implementation is bit wrong.
Here for your reference i am attaching the code:
if you have any doubt you can ask here:
Happy Learning!!
unordered_map<int,vector> m;
What if I use vector instead of list It will serve the same purpose.
and for which test case my code is failing so that I can try debugging it.
Actually all the test cases are larger so it will be very difficult for you to debug it.
you can make either of the option to store the vertices and the weight,
this is just the you have to map the pair value.
if you have any doubt you can ask here:
Happy Learning!!
while(!q.empty()){ int f=q.front(); q.pop(); for(auto temp:m[f])
I got my mistake actually I was considering neighbors of source again and again and not in f(q.front())
Thank You I am marking doubt as resolved
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.