Jun 122012
 

Write a function that accepts a string of parenthesis ( ‘(‘ and ‘)‘ characters ) and return true if parenthesis are matched and false otherwise (if the parenthesis are not matched).

For example, for the below input Strings, the return values should be as follows:

Input String: ( UnMatched
Input String: () Matched
Input String: (() UnMatched
Input String: ()() Matched
Input String: (((()))) Matched
Input String: ()()(()) Matched
Input String: (((() UnMatched

Continue reading »