comefrom: <gouthampradhan>string_FindWordsThatCanBeFormedbyCharacters_1.java
code: public int countCharacters(String[] words, String chars) {
      Map<Character, Integer> countMap = new HashMap<>();
      for (char c : chars.toCharArray()) {
        countMap.putIfAbsent(c, 0);
        countMap.put(c, countMap.get(c) + 1);
      }
      int ans = 0;
      for (String s : words) {
        Map<Character, Integer> subMap = new HashMap<>();
        for (char c : s.toCharArray()) {
          subMap.putIfAbsent(c, 0);
          subMap.put(c, subMap.get(c) + 1);
        }
        boolean possible = true;
        for (char k : subMap.keySet()) {
          if (!countMap.containsKey(k) || subMap.get(k) > countMap.get(k)) {
            possible = false;
            break;
          }
        }
        if (possible) {
          ans += s.length();
        }
      }
      return ans;
    }
masked: public int sample_funcname ( String [ ] var_1 , String var_2 ) {
    Map < Character , Integer > var_7 = new HashMap < > ( ) ;
    for ( char var_9 : var_2 . toCharArray ( ) ) {
      var_7 . putIfAbsent ( var_9 , 0 ) ;
      var_7 . put ( var_9 , var_7 . get ( var_9 ) + 1 ) ;
    }
    int var_15 = 0 ;
    for ( String var_16 : var_1 ) {
      Map < Character , Integer > var_17 = new HashMap < > ( ) ;
      for ( char var_9 : var_16 . toCharArray ( ) ) {
        var_17 . putIfAbsent ( var_9 , 0 ) ;
        var_17 . put ( var_9 , var_17 . get ( var_9 ) + 1 ) ;
      }
      boolean var_22 = true ;
      for ( char var_20 : var_17 . keySet ( ) ) {
        if ( ! var_7 . containsKey ( var_20 ) || var_17 . get ( var_20 ) > var_7 . get ( var_20 ) ) {
          var_22 = false ;
          break ;
        }
      }
      if ( var_22 ) {
        var_15 += var_16 . length ( ) ;
      }
    }
    return var_15 ;
  }
  