Snakes Ladder Problem in Graph Chanllenge

Could not found out the logical error in code present here https://ide.codingblocks.com/s/179255. This is failing in the second test case. Any help would be useful.

your code is failing the following test case
10
2
5 66
9 88
1
67 8
1
3 90
7
99 10
97 20
98 30
96 40
95 50
94 60
93 70
2
5 66
9 88
1
67 8
1
3 90
7
99 10
97 20
98 30
96 40
95 50
94 60
93 70
2
5 66
9 88
1
67 8
1
3 90
7
99 10
97 20
98 30
96 40
95 50
94 60
93 70
2
5 66
9 88
1
67 8
1
3 90
7
99 10
97 20
98 30
96 40
95 50
94 60
93 70
2
5 66
9 88
1
67 8
1
3 90
7
99 10
97 20
98 30
96 40
95 50
94 60
93 70

I hope i was able to help you, please mark your doubt as resolved if you are satisfied

Hey Tisan since you are not replying to this thread, I am marking your doubt as resolved for now, Please re-open if required

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.