Wrong Answer in BFS Shortest Path

Question link: https://hack.codingblocks.com/contests/c/537/763
Code Id : https://ide.codingblocks.com/s/70712

shubham u r only checking for distance not shortest path
check this
https://ide.codingblocks.com/s/70718

Hey Shubham,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.