NeetCode #369LC-921MediumStack
← Back to All Problems

#369 · #921 · Minimum Add to Make Parentheses Valid(使括号有效的最少添加)

📌 Problem Statement & Constraints

A parentheses string is valid if it is empty, or can be written as AB or (A) where A and B are valid. Given a string s, return the minimum number of parentheses to insert to make it valid. Constraints: 1 <= s.length <= 1000.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!