Этот код выводит байты из файла с минимальным количеством повторов. Первая половина кода мне понятна, вторая вообще нет. И соответственно не знаю, что нужно изменить, чтоб вывод был с максимальным количеством повторов. Буду очень благодарна за помощь. BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); InputStream inputStream = new FileInputStream(reader.readLine()); ArrayList<Integer> list = new ArrayList<>(); Map<Integer, Integer> map = new HashMap<>(); while (inputStream.available()>0) { int i = inputStream.read(); list.add(i); } inputStream.close(); for (int i = 0; i < list.size(); i++) { int count = 0; for (int j = 0; j < list.size(); j++) { if (list.get(i) == list.get(j)) { count++; } } map.put(list.get(i), count++); } int a = 0; for (Map.Entry<Integer, Integer> pair : map.entrySet()) { if (a == 0) { a = pair.getValue(); } else if (a > pair.getValue()) { a = pair.getValue(); } } for (Map.Entry<Integer, Integer> entry: map.entrySet()) { if (a == entry.getValue()) { System.out.print(entry.getKey() + " "); } } } }