H&M Interview Question

Question based on dsa ..Check for Balanced Bracket expression