BFS Shortest path Problem

I tried implementing this question, however the input is coming to be incorrect. Please help

LINK : https://ide.codingblocks.com/s/349141

Hey @gptradhika1208
Did some changes in ur code and mentioned them in comments : https://ide.codingblocks.com/s/349174 :slight_smile:
All changes except on line 48 is done because our map may not contain all the vertices (assume when edges <n-1)

And line 48 change is done because required by question that we dont print anything for shortest dist to start