So I know that the algo is -

```
for (int k = 0; k < n; k ++){
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
adj[i][j] = min(adj[i][j],adj[i][k]+adj[k][j]);
}
}
}
```

I wanted to ask that why does it become wrong when we change it to -

```
for (int i = 0; i < n; i ++){
for (int j = 0; j < n; j++){
for (int k = 0; k < n; k++){
adj[i][j] = min(adj[i][j],adj[i][k]+adj[k][j]);
}
}
}
```