So I think my problem is with the last index. I lowered down the number of words for the checking of the code so I know that's not a ten, but I just need to figure out the logic first and so far this is what I have. I'm not sure if I'm thinking about this right or doing this right. Please help!
package com.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.nio.Buffer;
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<>();
for (int i = 0; i < 3; i++)
{
list.add(reader.readLine());
}
int max = 0;
for (int i = 0; i < list.size(); i++)
{
if (list.get(i).length() >= max)
{
max = list.get(i).length();
} else
{
System.out.print(i);
}
}
}
}