Driver code .
public static void main ( String [ ] args ) { String s1 = " ) ( ) ( ( ) ) ) ) " ; String s2 = " ( ( ) ( ( ) ( " ; if ( isBalancedSeq ( s1 , s2 ) ) { System . out . println ( " Balanced " ) ; } else { System . out . println ( " Not ▁ Balanced " ) ; } } }