Przy różnych danych działa poprawnie a mimo to nie zalicza, dlaczego?
package pl.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Sprawdzanie kolejności
*/
public class Solution {
public static void main(String[] args) throws IOException {
//tutaj wpisz swój kod
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> lista = new ArrayList<String>();
for(int i=0; i<10; i++)
{
lista.add(reader.readLine());
}
String temp = lista.get(0);
int len = temp.length();
for(int i=0; i<10; i++)
{
temp = lista.get(i);
if(temp.length()<len) {
System.out.println(i);
break;
}
}
}
}