public boolean isComplete() {
    int size = board.length;
    
    for (int y = 0; y < size; y++) {
      for (int x = 0; x < size; x++) {
        if (x == size - 1 && y == size - 1 && board[x][y] == -1) return true;
        if (board[x][y] != y * size + x + 1) return false; // Bail early
      }
    }
    return false;
  }