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));