Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 921. Minimum Add to Make Parentheses Valid
Given a string of '(' and ')', return the minimum number of parentheses insertions needed to make the string valid. This is solved greedily by scanning once and counting unmatched closing parentheses and leftover opening parentheses that require insertions.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early November, 2025
Meta
Manager
Late October, 2025
Meta
Senior
Early June, 2025
Meta
Senior
Only dealing with parenthesis input
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.