with the last condition not met
i cannot see my mistakes even after several attemps
need help
package com.codegym.task.task07.task0709;
import java.io.*;
import java.util.*;
public class Solution{
private static ArrayList<String> strings = new ArrayList<String>(5);;
public static void main(String[] args)throws Exception{
ArrayList<String> lists = new ArrayList<String>(4);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for(int i=0; i<5; i++){
String s = reader.readLine();
strings.add(s);
}
int minstring = strings.get(0).length();
int minstringindex = 0;
for(int k=0;k<5;k++){
if(minstring > strings.get(k).length()){
minstring = strings.get(k).length();
minstringindex = k;
}
}
for(int j=0;j<5;j++){
if(strings.get(minstringindex).length() == strings.get(j).length() ){
lists.add(strings.get(j));
}
}
for(int l=0;l<lists.size();l++){
System.out.println(lists.get(l));
}
}
}