Adobe interview question

Balance Parentheses stack DSA question