Code doesn't work, no idea as to why, doesn't print anything at all.
package com.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
/*
Checking the order
*/
public class Solution {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < 10; i++) {
list.add(scanner.nextLine());
}
for (int i = 0; i < list.size(); i++) {
if (list.get(i).length() > list.get(i++).length()) {
System.out.println(list.indexOf(i));
break;
}
}
}
}