For this Question: Given an integer N, print all balanced bracket strings of length 2*N.
A bracket string is a string that contains only '(' and ')' as its characters.
<ul>
 <li>Empty string is a balanced bracket string</li>
 <li>If <i>S</i> is a balanced bracket string, so is <i>(S)</i></li>
 <li>If <i>S</i> and <i>T</i> are balanced bracket strings, so is <i>ST</i></li>
</ul> 
Print in lexicographical order. '(' appears before ')' in lexicographical orderThe single line of input containing an integer N.
1 <= N <= 15Print all possible balanced bracket strings of length 2*N in a separate line.Sample Input 1:
1

Sample Output 1:
()

Sample Input 2:
3

Sample Output 2:
((()))
(()())
()(())
()()()

Explanation:
It is printed in lexicographical order ., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static ArrayList premutaionsB(ArrayList<String> arr, int n){
		if(n == 1)
			return arr;

		else{
			ArrayList<String> arr2 = new ArrayList<>();
			for(int i=0;i<arr.size();i++)
				arr2.add("(" + arr.get(i) + ")");

			for(int i=0;i<arr.size();i++)
				arr2.add("()" + arr.get(i));

			return premutaionsB(arr2, n-1);
		}
	}
	public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<String> arr = new ArrayList<>();
		arr.add("()");
		arr = premutaionsB(arr, n);
		for(int i=0;i<arr.size();i++)
			System.out.println(arr.get(i));
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?