MathWorks Interview Question

valid parentheses