public class Solution {
    public static void main(String[] args) throws IOException {
        ArrayList<String> list = new ArrayList<>();
        int minIndex = 0;
        int maxIndex = 0;
        int minLength;
        int maxLength;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        for (int i = 0; i < 10; i++) {
            list.add(reader.readLine());

        }
        minLength = list.get(0).length();
        maxLength = list.get(0).length();

        for (int i = 0; i < 10; i++) {
            if (list.get(i).length() < minLength){
                minLength = list.get(i).length();
                minIndex = i;
            }
            else if (list.get(i).length() > maxLength){
                maxLength = list.get(i).length();
                maxIndex = i;
            }

        }
        if (minIndex < maxIndex){
            System.out.println(list.get(minIndex));
        }
        else if (maxIndex < minIndex){
            System.out.println(list.get(maxIndex));
        }
    }
}
Вопрос следующий: В условии четко сказано, что должна быть выведена только одна строка, но в ситуации, когда все строки листа будут одинаковой длины, ни одна строка не будет выведена, тем не менее, задача прошла валидацию, я что-то не понимаю?