79103053

Date: 2024-10-18 17:19:21
Score: 1
Natty:
Report link

Thanks @Sweeper It's always obvious once you've figured out the answer.

    int size = ...
    var a = myHashMap.entrySet()
      .stream()
      .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
      .map(e -> String.format("%s %.3f", e.getKey(), 100.0 * e.getValue() / size))
      .toList();
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Sweeper
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: igouy