What's wrong with my code? It compiles and the results are proper, but 3. and 4. requirement's aren't completed. Could anybody help? ;)
package pl.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
/*
Sprawdzanie kolejności
*/
public class Solution {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
ArrayList<String> list = new ArrayList<>();
for(int i = 0; i < 10; i++){
list.add(sc.next());
}
for(int j = 0; j < 9; j++){
if(list.get(j).length() > list.get(j + 1).length()){
System.out.println(j+1);
break;
}
}
}
}