What is the error in this code? Sample inputs are giving correct output, but test case is not getting passed!
DIJKSTRA'S ALGORITHM
hello @AbhilashaBansal
the issue is in printing distance.
dist will contain keys that are directly or indirectly connected with src.
but we need print distance of source vertex to all other vertex.
your print should look like this.

check ur updated 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.
Yes, I got that now. I wasn’t considering the vertices that have no edge whatsoever. Thank you for your help!