Программа выполняет требования, но валидатор не пускает :(
package com.javarush.task.task07.task0712;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Самые-самые
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> strings = new ArrayList<String>();
for (int i = 0; i < 10; i++)
{
String s = reader.readLine();
strings.add(s);
}
int count = 6;
int count1 = 6;
int min = strings.get(0).length();
String[] s2 = new String[10];
for (int j = 0; j<10 ; j++) {
if (strings.get(j).length()<=min)
{
min = strings.get(j).length();
count = j;
s2[j] = strings.get(j);}
}
String[] s1 = new String[10];
int max = strings.get(0).length();
for (int j = 0; j<10 ; j++) {
if (strings.get(j).length()>=max){
max = strings.get(j).length();
count1 = j;
s1[j] = strings.get(j);}
}
if (count1<count)
System.out.println(strings.get(count1));
else
System.out.println(strings.get(count));
}
}