If current character is a closing bracket , pop from stack . If stack is empty , then this closing bracket is required bracket .
else if ( expression [ i ] == ' ] ' ) { st . pop ( ) ; if ( st . empty ( ) ) { cout << expression << " , ▁ " << index << " : ▁ " << i << " STRNEWLINE " ; return ; } } }