Balance or not expression
a string consisisting of characters < and >. The string is balanced if each < always appesrs before a corresponing > and more over each < and > act as a unique pairof symbols To balance a string any > characters can b ereplace with < >. Given an express and a maximum number of replacements, determine whether the string can be balanced:
example: expression =['<<>>','<>',<><>','>>','><><'] maxReplacements =[0,1,2,2,2,2]
Last updated