Hey community,
programm works fine by pressing "Run" but doesnt fullfill the requirements of the task for some reasons?
Can you maybe help me figure them out ?
Thank you !
Noah
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 br = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String>list = new ArrayList<String>();
for(int i = 0; i < 10; i++){
list.add(br.readLine());
}
int laenge = list.get(0).length();
for(int i = 1; i < 10; i++){
if(list.get(i).length() < laenge){
String s = list.get(i);
int j = list.indexOf(s);
System.out.println(i);
break;
}
}
}
}