Red Hat Interview Question

Validate parentheses sequence with multiple types