If current bracket is a closing bracket then pop from stack if it is not empty . If stack is empty then sequence is not balanced .
else { if ( st . empty ( ) ) { return false ; } else st . pop ( ) ; } }