Snakes and ladder problem


sir it is giving wrong ans please help

@Shivanchal-Agarwal-2530139037020445
There are few mistakes in your code. I am pointing them, plz update changes accordingly

  1. Increase size of board to 110
  2. line 67 should be int j = i+d+board[i+d];
  3. 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!!