style: include WMI_WRONG_MAP_ITERATOR (#5206)

This commit is contained in:
Piotr Idzik
2024-06-05 20:52:12 +02:00
committed by GitHub
parent 440f3ce18b
commit b315b7d578
4 changed files with 9 additions and 25 deletions

View File

@ -38,9 +38,9 @@ public final class Mode {
int max = Collections.max(count.values());
ArrayList<Integer> modes = new ArrayList<>();
for (int num : count.keySet()) {
if (count.get(num) == max) {
modes.add(num);
for (final var entry : count.entrySet()) {
if (entry.getValue() == max) {
modes.add(entry.getKey());
}
}
return modes.stream().mapToInt(n -> n).toArray();