Why isnt it working? I dont understand
package en.javarush.task.jdk13.task07.task0712;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Minimum or maximum
*/
public class Solution {
public static ArrayList<String> strings;
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader re = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> sts = new ArrayList<>();
for (int i = 0; i < 1; i++) {
sts.add(re.readLine());
}
String miS = sts.get(0);
int miP = 0;
String maS = sts.get(0);
int maP = 0;
for(int i=0;i<10;i++){
if(sts.get(i).length()>maS.length()){
maP=i;
maS=sts.get(i);
} else if(sts.get(i).length()<miS.length()){
miP=i;
miS=sts.get(i);
}
}
if(miP<maP)
System.out.print(miS);
else System.out.print(maS);
}
}