📅  最后修改于: 2022-03-11 14:52:13.789000             🧑  作者: Mango
Map frequencies = new HashMap<>();
for (char ch : input.toCharArray())
frequencies.put(ch, frequencies.getOrDefault(ch, 0) + 1);