Snakes and ladder

Hello could you please, tell me where i’m going wrong it’s giving me runtime error and explain me the scenario when the answer is gonna be -1

hi @msid78641 you need to add the edge 100,100 as well.

to reach 100, you can come only from 99, 98, 97,96,95, or 94 (getting 1-6)
now imagine that if there are snakes present at all of these numbers, then you will never be able to reach 100. So the answer in this case will be -1