Can someone help? When i run the task, it completes and i get the desired output as per the task itself, however if i attempt to verify my code it says there may be an infinite loop as its taking too long but when run it completes in a second?![]()

package en.codegym.task.jdk13.task07.task0720;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Shuffled just in time
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int sizeOfList = Integer.parseInt(reader.readLine());
int secNum =Integer.parseInt(reader.readLine());
ArrayList<String> list =new ArrayList<String>(8);
for(int i =0; i<sizeOfList; i++){
list.add(reader.readLine());
}
ArrayList<String> secondList = new ArrayList<String>();
for (int i = secNum; i< list.size(); i++){
secondList.add(list.get(i));
}
for(int i =0; i< list.size()- secNum; i++){
secondList.add(list.get(i));
}
for(int i =0; i<secondList.size(); i++){
System.out.println(secondList.get(i));
}
}
}