2
votes
Print the three most occurring chars in Java using streams
Just a two small things:
(a, b) -> {
a.put(b, a.getOrDefault(b, 0L) + 1L);
return a;
}
This lambda should use better parameter names, for example ...
2
votes
Print the three most occurring chars in Java using streams
You should split this up into multiple functions for reuse and testability; especially, do not force a print - near the top level should be a format.
Do not use manual string concatenation ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sorting × 1152algorithm × 320
java × 266
python × 210
c++ × 194
performance × 146
mergesort × 142
javascript × 126
beginner × 111
array × 101
c × 100
c# × 84
quick-sort × 80
python-3.x × 63
insertion-sort × 46
programming-challenge × 44
reinventing-the-wheel × 33
c++11 × 32
strings × 29
recursion × 27
time-limit-exceeded × 25
radix-sort × 25
php × 24
hash-map × 23
ruby × 22