I don't understand why I don't sodisfact the request..
I have check the solution and the only difference is I'm using for each loop and in the solution use a for loop but the code will work aniway
package com.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Checking the order
*/
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader txt = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
for(int i = 0; i < 10; i++) {
list.add(txt.readLine());
}
String min = list.get(0);
for(String nome : list){
if(nome.length() >= min.length()){
min = nome;
}else{
System.out.println(nome);
break;
}
}
}
}