Snakes and ladder - Graph

getting Runtime error
ide: https://ideone.com/e7iBNg

Hi @Vishal123,
i hv updated ur code.


refer to dis.
in ur parent map, in ur code u were making dist[i.first]=INT_MAX, here i.first can never be 36 since 36 is not a parent node.so when u were comparing dist[neighbour]==INT_MAX, dist[36]=0 hencewas never pushed in queue.
Hence its parent was never defined.
So, try making dist[ 1 to 42]=INT_MAX and try running ur code.
Hope dis resolves ur doubt.