Check if given string is balanced bracket sequence or not .
static boolean isBalanced ( String s ) { Stack < Character > st = new Stack < Character > ( ) ; int n = s . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) {