The answer is correct still not passing pls tesll the error and pls edit the code and send me for better understanding.
Thank you.
I am not able to pass the test case pls look into this
@AMAN-2000
There are few mistakes in your code
- the graph which is declare outside for loop of testcase should be initialise inside for loop.
- condition in line 107 shoulde be for(int i=0;i<m;i++). No. of edges are m not n
- change un_ordered map in line 33 to normal map<T,int> dist.
- you have missed that condition when some node is not reachable. In that case you have to print “-1” for those nodes.