Balanced Tag

Akash likes Balanced Parentheses. For example -

Akash likes expression 1 but he doesnot like expression 2. In this problem, you have to help Akash by telling if a given expression consisting of TAGS ( <> or </> or X ) is balanced or not. The right orders of the expressions consisting of tags are <X> or <X/> or </> or <> or X , where X can be a certain length of string consisting of lower case english letters (‘a’-‘z’), space (’ ‘) and these characters (’<‘, ‘>’). Note that, any characters after / without > should be considered Invalid.


This is a companion discussion topic for the original entry at https://toph.co/p/balanced-tag