String ss = "Pawan kavita kiyansh Patidar Patidar";
StringBuilder ress = new StringBuilder();
Map<Character, Integer> fre = ss.chars().boxed()
.collect(Collectors.toMap(k->Character.valueOf((char) k.intValue()),k->1,Integer::sum));
//fre.forEach((k, v) -> System.out.println((k + ":" + v)));
fre.entrySet().forEach(e ->{
//System.out.println(e.getKey() + ":" + e.getValue());
//ress.append(String.valueOf(e.getKey())+e.getValue());
});
fre.forEach((k,v)->{
//System.out.println("Item : " + k + " Count : " + v);
ress.append(String.valueOf(k)+String.valueOf(v));
});
System.out.println(ress.toString());