I don't know what's wrong.
package com.codegym.task.task18.task1804;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
/*
Rarest bytes
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader( new InputStreamReader( System.in ));
FileInputStream fis = new FileInputStream( br.readLine() );
br.close();
HashMap<Integer, Integer> map = new HashMap<>();
int min = 1;
while ( fis.available() > 0 ) {
int input = fis.read();
if ( !map.containsKey( input ) ) {
map.put(input, 1);
}
else {
map.replace( input, map.get(input) + 1 );
if ( !map.containsValue( min ) ) {
min = map.get( input );
}
}
}
fis.close();
for ( Map.Entry<Integer, Integer> pair : map.entrySet() ) {
if ( pair.getValue() <= min ) {
System.out.print( pair.getKey() + " " );
}
}
}
}