Driver Code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT X = " [ ( ) ] ( ) " NEW_LINE n = 6 NEW_LINE if ( isBalanced ( X , n ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT Y = " [ [ ( ) ] ] ) " NEW_LINE n = 7 NEW_LINE if ( isBalanced ( Y , n ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT