what ' s wrong with condition 4 please help me to solve this
package com.codegym.task.task07.task0709;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Expressing ourselves more concisely
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code he
ArrayList<String> list = new ArrayList<String>();
BufferedReader br = new BufferedReader( new InputStreamReader(System.in));
for(int i = 0; i < 5;i++){
list.add(br.readLine());
}
String shortes = list.get(0);
String h = "";
for(String st : list) {
if (st.length() < shortes.length()) {
shortes = st;
}
if (st.length() == shortes.length()){
h = st;
}
}
System.out.println(shortes);
}
}