如何在地图中求解地图

时间:2019-12-10 17:02:04

标签: java hashmap

HashMap<Character, Integer> innermap = new HashMap<Character, Integer>();
        HashMap<Integer, HashMap<Character, Integer>> outermap = new HashMap<Integer,HashMap<Character, Integer>>();
        Integer i =0;

        for(char c : chars) 
        {
            if(innermap.containsKey(c)) {
                int counter = innermap.get(c);  
                outermap.put(i, innermap.put(c,++counter));

0 个答案:

没有答案