I'm confused on what to do for the last task. Could someone please guide me.
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 reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
for (int i=0; i<10; i++){
list.add(reader.readLine());
}
for (int x=0; x<9; x++){
if (list.get(x).length()<list.get(x+1).length()){
}
else if (list.get(x).length()>list.get(x+1).length()){
System.out.println(list.get(x));
break;
}
}
}
}