Code not working

code-https://ide.codingblocks.com/s/343672
i don’t know where I’m going wrong

hello @amanb25

image

the issue is with this for loop.
a) u have assumed that src will always be 1 , which is not correct.
b) if ur dist[i]==INT_MAX then u need to print -1.
image

I updated my code to this but it still gives run error-https://ide.codingblocks.com/s/343672

@amanb25
u need to clear ur graph for each test case.

ur updated code->

1 Like

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.