H&M interview question

Question based on dsa ..Check for Balanced Bracket expression