Please check my code

I’m using a map to store the edges which are either connected with a ladder or a snake.
I do this because when ill be adding an edge for all the vertices if there is a vertex that is connected to some other I’ll directly link it to the first vertex.
Please check where I’m going wrong.
code- https://ide.codingblocks.com/s/342238

Hey @amanb25
Mentioned the changes in comments : https://ide.codingblocks.com/s/342388