Code not working, Please Help

Problem: https://practice.geeksforgeeks.org/problems/shortest-source-to-destination-path3544/1/?category[]=Graph&category[]=Graph&problemStatus=unsolved&difficulty[]=1&page=2&query=category[]GraphproblemStatusunsolveddifficulty[]1page2category[]Graph#

My soln: https://ide.codingblocks.com/s/597187

@anshufirefox i can not see your see your code but you can simply do a bfs from node 0 to node x,y it will give shortest distance and only consider nodes which have 1 in them

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.