private int solve(final byte[][] work, final int depth) {
        Position pos = null;
        for (byte y = 0; pos == null && y < 9; y++) {
            for (byte x = 0; pos == null && x < 9; x++) {
                if (work[x][y] == 0) {
                    pos = new Position(x, y);
                }
            }
        }
        if (pos == null) {
            return depth + 1;
        }
        int x = pos.getX();
        int y = pos.getY();

        boolean[] possible = possible(work, pos);
        for (byte i : rand10()) {
            if (possible[i]) {
                work[x][y] = i;
                int val = solve(work, depth + 1);
                if (val > 0) {
                    return val + 1;
                }
            }
        }
        work[x][y] = 0;
        return -1;
    }