79088001

Date: 2024-10-14 23:50:21
Score: 0.5
Natty:
Report link

Simple as this:

String s = "aabbcd";

Map<Character, Integer> map = new HashMap<>();
    for (var c: s.toCharArray()){
        map.put(c, (int)Arrays.stream(s.chars().toArray()).filter((i)->i == c).count());
    }

Output: {a=2, b=2, c=1, d=1}

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Shtefan