Given a list of strings of bracket characters: (), the string of brackets is balanced under the following conditions: 1. It is the empty string. 5 6 2. If strings a and bare balanced, then ab is balanced. 7 8 9 10 3. If string a is balanced, then (a) and {a} are balanced. 11 12 13 Write a class that determines whether the brackets in each string are balanced and returns true if the string is balanced, or false if it is not. 14 15 > t Example 0 s=["00", "{0}", "({0})"] s[0] exhibits condition 2 above. "{}" and " ()" are balanced, so "{}()" is balanced. Return true. s[1] exhibits condition 3 above. "()" is balanced, so "{()}" is balanced. Return true



Answer :

Other Questions