Wrong answer for the final test case

https://ide.codingblocks.com/s/162609 This is my code. It is showing correct answer for given test case but showing wrong answer on submission

there is a mistake while taking the input
see the ā€œā€”>ā€ symbol to see the changes

public static void main(String args[]) {
int n;
String str;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
sc.nextLine();
while(nā€“>0){ ----->
str=sc.nextLine();
ArrayList br=new ArrayList<>();
br=getss(str);
for(String ans : br)
System.out.println(ans);
}

hope this will help u
pls rate my work so that i can improve my work