If current character is a closing bracket , pop from stack . If stack is empty , then this closing bracket is required bracket .
else if ( expression . charAt ( i ) == ' ] ' ) { st . pop ( ) ; if ( st . empty ( ) ) { System . out . print ( expression + " , ▁ " + index + " : ▁ " + i + "NEW_LINE"); return ; } } }