public class Solution {
    public String getHint(String secret, String guess) {
        int bull = 0, cow = 0, cache[] = new int[10];
        for (int i = 0; i < secret.length(); i++) {
            if (secret.charAt(i) == guess.charAt(i)) {
                bull++;
            } else {
                if (cache[Character.getNumericValue(secret.charAt(i))]++ < 0) cow++;
                if (cache[Character.getNumericValue(guess.charAt(i))]-- > 0) cow++;
            }
        }
        return String.valueOf(bull) + "A" + String.valueOf(cow) + "B";
    }
}

@@ -310,34 +310,8 @@
 che%5B
-Character.getNumericValue(
 secr
@@ -322,17 +322,21 @@
 harAt(i)
-)
+ - 48
 %5D++ %3C 0)
@@ -373,34 +373,8 @@
 che%5B
-Character.getNumericValue(
 gues
@@ -384,17 +384,21 @@
 harAt(i)
-)
+ - 48
 %5D-- %3E 0)

optimize #299