Bfs snake and ladder


whats the prblm in rhis code

@deepakjumani09
There are few mistake in your code. I am pointing those mistake plz correct them

  1. line no. 32 should be if(dist[nbr]>(dis[node]+1)){
  2. line 68 should be board[i]=ladder[i];
  3. line 71 should be board[i]=snake[i];
  4. delete line 78 to 80 and write
    if(i+j<=n){
    g.addEdge(i,i+j);
    if(board[i+j]!=0){ g.addEdge(i,board[i+j]); }
    }
  5. source index in 1 not 0, so change line 85 to g.bfs(1,n);