We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4626b91 commit ce0bed5Copy full SHA for ce0bed5
week4/priority-queues/assignment-8-puzzle/Board.java
@@ -57,7 +57,8 @@ public int manhattan() {
57
for (int i = 0; i < dimension(); ++i)
58
for (int j = 0; j < dimension(); ++j) {
59
int v = tiles[i][j];
60
- v = v == 0 ? n * n : v;
+ if (v == 0) continue;
61
+
62
int x = (v - 1) / n;
63
int y = (v - 1) % n;
64
0 commit comments