sir it is giving wrong ans please help
Snakes and ladder problem
@Shivanchal-Agarwal-2530139037020445
There are few mistakes in your code. I am pointing them, plz update changes accordingly
- Increase size of board to 110
- line 67 should be int j = i+d+board[i+d];
- you have not considered case when it is impossible to reach destination. In that case you have to print “-1”. Just add one condition before line 39
if(dist[dest]==INT_MAX){ return -1; }
thank you sir got it!!