Wrong answer submitting in wrong

Answer is valid still wrong answer. the code is not submitting although the testcase.

@shudhanshu20092001_af6f20d24c617008 Your code is printing :
(())
()()
but the correct order is :
()()
(())
notice your order is different and however the answer is correct your order should match also.
To cure this :
First make call to closing brackets instead of opening brackets :
Corrected Code :

import java.util.*;
public class Main {
	static ArrayList<String> list=new ArrayList<>();
    public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		findparethenes("(",1,0,n);
    for(String val: list)
	System.out.println(val);
    }
	public static void findparethenes(String current,int o,int c,int n) 
	{
	if(current.length()==2*n)
	{
      list.add(current);
	  return;
	}	
	if(c<o)
	{
		findparethenes(current+")",o,c+1,n);
	}
	if(o<n)
	{
		findparethenes(current+"(",o+1,c,n);
	}
	}
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.