Uber Interview Question

Parentheses matching