Dijkstra algorithm

Can you please help me with my code. Its giving the correct ans for the sample case but is failing to get accepted.

Hello @rahul.gupta03111999 please wait i am checking your code.

Sir, are you done checking the code ?

@rahul.gupta03111999 see this code:


there was mistake with the printing part i.e for -1.
Happy Learning!!

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.