boolean prevValid = false;
for (int j = 0; j < valid[i].length; ++j) {
if (valid[i][j]) {
if (prevValid) {
PuzzleMessage result = new PuzzleMessage(true);
result.addErrorLocation(new Vec2i(i, j));
result.addErrorLocation(new Vec2i(i, j - 1));
return result;
}
prevValid = true;
if (valid[i + 1][j]) {
PuzzleMessage result = new PuzzleMessage(true);
result.addErrorLocation(new Vec2i(i, j));
result.addErrorLocation(new Vec2i(i + 1, j));
return result;
}
} else {
prevValid = false;
}