private void validate() {
        for (int i = 1; i <= dimension; i++) {
            for (int j = i + 1; j <= dimension; j++) {
                if (Math.abs(j - i) == Math.abs(queens[j] - queens[i])) {
                    System.out.println(String.format("Invalid: %d %d", i, j));
                    return;
                }
                for (int k = j + 1; k <= dimension; k++) {
                    int rowDiff1 = j - i;
                    int rowDiff2 = k - j;
                    if (rowDiff1 * (queens[k] - queens[j]) == rowDiff2 * (queens[j] - queens[i])) {
                        System.out.println(String.format("Invalid %d %d %d", i, j, k));
                        return;
                    }
                }
            }
        }
        System.out.println("Validated");
    }