When I run my code, it works perfectly fine. It also fulfills all the conditions but somehow it's not verifying.I can't see where the problem is. Please help to identify it.
package com.codegym.task.task07.task0710;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
To the top of the list
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
ArrayList<String> list = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//list.add(0, reader.readLine());
for(int i=0; i<10; i++)
{
list.add(0, reader.readLine());
for(int j=0; j==i; j++)
{
list.add(j+1, list.get(j));
}
}
for(int i=0; i<10; i++)
{
System.out.println(list.get(i));
}
}
}