Dijshiktra's code

sir why my code not works


for the i/p the code works fine

what is the issue??

mam code give wrong answer in test case

wait let me check …

unordered map use nhi karna
since o/p order matters
and then
image
first check if INT_MAX display -1 else c.second