Hot answers tagged

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 ...
RoToRa's user avatar
  • 10.9k
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 ...
Reinderien's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible