Bright Data Interview Question

Valid Parentheses (you can check leetcode)