Function to find the lexicographically next balanced bracket expression if possible
string next_balanced_sequence ( string & s ) { string next = " - 1" ; int length = s . size ( ) ; int depth = 0 ; for ( int i = length - 1 ; i >= 0 ; -- i ) {