The previous task for maximum I passed, and I used the exact same code except swapped min for max, but this doesn't pass one of the validations for some reason.
package com.codegym.task.task18.task1804;
import java.io.*;
import java.util.Arrays;
import java.util.stream.IntStream;
/*
Rarest bytes
*/
public class Solution {
public static void main(String[] args) throws Exception {
File file;
try (BufferedReader buff = new BufferedReader(new InputStreamReader(System.in))) {
file = new File(buff.readLine());
}
int[] byteCount = new int[255];
try (FileInputStream stream = new FileInputStream(file)) {
while (stream.available() > 0) byteCount[stream.read()]++;
}
int min = Arrays.stream(byteCount).min().getAsInt();
IntStream.range(0, byteCount.length).filter(i -> byteCount[i] == min).forEach(f -> System.out.print(f + " "));
}
}