Driver Code
public static void main ( String [ ] args ) { int N = 7 ; ArrayList < String > list = new ArrayList < String > ( ) ; list . add ( " ) ( ) ) " ) ; list . add ( " ) " ) ; list . add ( " ( ( " ) ; list . add ( " ( ( " ) ; list . add ( " ( " ) ; list . add ( " ) " ) ; list . add ( " ) " ) ; countPairs ( N , list ) ; } }