PwC Interview Question

an leetcode question valid parenthesis