Not able to figure out the issue with code.. Pgm is meant to fnd the minimum of the arraylist.. https://codegym.cc/quests/lectures/questsyntax.level07.lecture06 Code: import java.util.ArrayList; import java.io.BufferedReader; import java.io.InputStreamReader; /* shortest string */ public class Solution { private static ArrayList<String> strings = new ArrayList<String>(); public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); for (int i=0; i<5; i++) { String element = reader.readLine(); strings.add(i, element); } int min = 9999; for(int i=0; i<strings.size();i++) { if (strings.get(i).length() < min) { min = strings.get(i).length(); } } for (int i=0; i<strings.size();i++) { if(strings.get(i).length() == min) { System.out.println(strings.get(i)); } } } }