Design an algorithm for parsing code to check whether all the brackets and parentheses match.
Anonymous
For just parentheses, maintain a counter that increments when an opening bracket is encountered and decrements when a closing bracket is encountered. At the end, if the count = 0, all parentheses match, if count > 0 there are too many opening parentheses, and too few if count < 0.
Check out your Company Bowl for anonymous work chats.