Hi guys, not passing second condition, not sure why when i have added strings to list using reader and loop. Rest of the conditions pass and code runs fine, please help, thanks.
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 {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < 10; i++){
list.add(reader.readLine());
}
ArrayList<String> helpList;
helpList = list;
helpList.add(0, "");
int i = 0;
int k = 1;
for (; i < 10; i++, k++) {
if (list.get(i).length() <= helpList.get(k).length()) {
}
else {
System.out.println(i);
break;
}
}
}
}