private boolean checkSub(char[][] board) {
        for (int i = 0; i < 9; i += 3) {
            for (int j = 0; j < 9; j += 3) {
                HashSet<Character> set = new HashSet<Character>();
                for (int m = i; m < i + 3; m++) {
                    for (int n = j; n < j + 3; n++) {
                        if (board[m][n] == '.') {
                            continue;
                        }
                        if (!set.contains(board[m][n])) {
                            set.add(board[m][n]);
                        }
                        else {
                            return false;
                        }
                    }
                }
            }
        }
        return true;
    }