<qiyuangong>811_Subdomain_Visit_Count_1.java
public List<String> subdomainVisits(String[] cpdomains) {
        Map<String, Integer> map = new HashMap();
        for (String cpdomain : cpdomains) {
            int i = cpdomain.indexOf(' ');
            int n = Integer.valueOf(cpdomain.substring(0, i));
            String domain = cpdomain.substring(i + 1);
            for (i = 0; i < domain.length(); ++i) {
                if (domain.charAt(i) == '.') {
                    String d = domain.substring(i + 1);
                    map.put(d, map.getOrDefault(d, 0) + n);
                }
            }
            map.put(domain, map.getOrDefault(domain, 0) + n);
        }

        List<String> res = new ArrayList();
        for (String domain : map.keySet()) res.add(map.get(domain) + " " + domain);
        return res;
    }
public List < String > var_1 ( String [ ] var_2 ) {
  Map < String , Integer > var_6 = new HashMap ( ) ;
  for ( String var_7 : var_2 ) {
    int var_10 = var_7 . indexOf ( ' ' ) ;
    int var_14 = Integer . valueOf ( var_7 . substring ( 0 , var_10 ) ) ;
    String var_16 = var_7 . substring ( var_10 + 1 ) ;
    for ( var_10 = 0 ;
    var_10 < var_16 . length ( ) ;
    ++ var_10 ) {
      if ( var_16 . charAt ( var_10 ) == '.' ) {
        String var_20 = var_16 . substring ( var_10 + 1 ) ;
        var_6 . put ( var_20 , var_6 . getOrDefault ( var_20 , 0 ) + var_14 ) ;
      }
    }
    var_6 . put ( var_16 , var_6 . getOrDefault ( var_16 , 0 ) + var_14 ) ;
  }
  List < String > var_25 = new ArrayList ( ) ;
  for ( String var_16 : var_6 . keySet ( ) ) var_25 . add ( var_6 . get ( var_16 ) + " " + var_16 ) ;
  return var_25 ;
}
