TikTok interview question

Leetcode 678. Valid Parenthesis String