Snapsheet Interview Question

matching parentheses