int getB(String s1, String s2) {
        int b = 0;
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 4; j++) {
                if (i == j) { // this situation has handled by getA.
                    continue;
                }
                if (s1.charAt(i) == s2.charAt(j)) { // if their digit matched, but their position must be different.
                    b++;
                }
            }
        }
        return b;
    }