comefrom: <awangdev>299. Bulls and Cows_2.java
code: public String getHint(String secret, String guess) {
          if (secret == null || guess == null || secret.length() == 0 || guess.length() == 0) {
              return "0A0B";
          }
          
          char[] secretArr = secret.toCharArray();
          char[] guessArr = guess.toCharArray();
          
          Map<Character, Integer> secretMap = new HashMap<>();
          Map<Character, Integer> guessMap = new HashMap<>();
          
          int bulls = 0;
          for (int i = 0; i < secretArr.length; i++) {
              char a = secretArr[i], b = guessArr[i];
              if (a == b) {
                  bulls++;
              } else {
                  secretMap.putIfAbsent(a, 0);
                  secretMap.put(a, secretMap.get(a) + 1);
                  guessMap.putIfAbsent(b, 0);
                  guessMap.put(b, guessMap.get(b) + 1);
              }
          }
          
          int cows = 0;
          for (Map.Entry<Character, Integer> entry : secretMap.entrySet()) {
              char key = entry.getKey();
              if (guessMap.containsKey(key)) {
                  cows += Math.min(entry.getValue(), guessMap.get(key));
              }
          }
  
          return String.format("%sA%sB", bulls, cows);
      }
masked: public String var_0 ( String var_1 , String var_2 ) {
    if ( var_1 == null || var_2 == null || var_1 . length ( ) == 0 || var_2 . length ( ) == 0 ) {
      return "0A0B" ;
    }
    char [ ] var_3 = var_1 . toCharArray ( ) ;
    char [ ] var_4 = var_2 . toCharArray ( ) ;
    Map < Character , Integer > var_5 = new HashMap < > ( ) ;
    Map < Character , Integer > var_6 = new HashMap < > ( ) ;
    int var_7 = 0 ;
    for ( int var_8 = 0 ;
    var_8 < var_3 . length ;
    var_8 ++ ) {
      char var_9 = var_3 [ var_8 ] , var_10 = var_4 [ var_8 ] ;
      if ( var_9 == var_10 ) {
        var_7 ++ ;
      }
      else {
        var_5 . putIfAbsent ( var_9 , 0 ) ;
        var_5 . put ( var_9 , var_5 . get ( var_9 ) + 1 ) ;
        var_6 . putIfAbsent ( var_10 , 0 ) ;
        var_6 . put ( var_10 , var_6 . get ( var_10 ) + 1 ) ;
      }
    }
    int var_11 = 0 ;
    for ( Map . Entry < Character , Integer > var_12 : var_5 . entrySet ( ) ) {
      char var_13 = var_12 . getKey ( ) ;
      if ( var_6 . containsKey ( var_13 ) ) {
        var_11 += Math . min ( var_12 . getValue ( ) , var_6 . get ( var_13 ) ) ;
      }
    }
    return String . format ( "%sA%sB" , var_7 , var_11 ) ;
  }
  