public boolean valid(char[][] board, int row, int column, int[] occupy) {
        for (int i = 0; i < column; ++i) {
            if (occupy[i] == row)
                return false;
        }
        for (int i = 0; i < column; ++i) {
            int dx = Math.abs(i - column);
            int dy = Math.abs(occupy[i] - row);
            if (dx == dy)
                return false;
        }
        return true;
    }