The task shows error "It requires five strings in output".I have done it as per the problem statement and it is working.what is wrong?
package com.codegym.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Remove and insert
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code
ArrayList<String> List = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for(int i = 0;i <= 4 ;i++)
{
String s = reader.readLine();
List.add(i,s);
}
for(int j=0;j <= 12;j++)
{
String t = List.remove(4);
List.add(0,t);
System.out.println(List);
}
}
}