Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT string = " ( ) ) ( ( ) ) ( ( ) ) ( " ; NEW_LINE n = len ( string ) NEW_LINE BCP = [ 0 for i in range ( n + 1 ) ] ; NEW_LINE BOP = [ 0 for i in range ( n + 1 ) ] ; NEW_LINE constructBlanceArray ( BOP , BCP , string , n ) ; NEW_LINE startIndex = 5 NEW_LINE endIndex = 11 ; NEW_LINE print ( " Maximum ▁ Length ▁ Correct ▁ " + " Bracket ▁ Subsequence ▁ between ▁ " + str ( startIndex ) + " ▁ and ▁ " + str ( endIndex ) + " ▁ = ▁ " + str ( query ( BOP , BCP , startIndex , endIndex ) ) ) ; NEW_LINE startIndex = 4 ; NEW_LINE endIndex = 5 ; NEW_LINE print ( " Maximum ▁ Length ▁ Correct ▁ " + " Bracket ▁ Subsequence ▁ between ▁ " + str ( startIndex ) + " ▁ and ▁ " + str ( endIndex ) + " ▁ = ▁ " + str ( query ( BOP , BCP , startIndex , endIndex ) ) ) NEW_LINE startIndex = 1 ; NEW_LINE endIndex = 5 ; NEW_LINE print ( " Maximum ▁ Length ▁ Correct ▁ " + " Bracket ▁ Subsequence ▁ between ▁ " + str ( startIndex ) + " ▁ and ▁ " + str ( endIndex ) + " ▁ = ▁ " + str ( query ( BOP , BCP , startIndex , endIndex ) ) ) ; NEW_LINE DEDENT