I have no idea how to complete this without cheating. Can someone give me clues or walkthroughs? I am very frustrated.
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.Arrays;
/*
Checking the order
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
for (int i = 0; i < 10; i++){
String s = reader.readLine();
list.add(s);
}
for (int j = 0; j < list.size(); j++){
if(list.get(j).length() > j++){
System.out.println(list.indexOf(list.get(j)));
}
}
}
}