← All problems

Valid Parentheses (extended: minimum removals)

Medium stacksstrings LeetCode ↗
Given a bracket string, remove the minimum brackets to make it valid.

Hints (0/3 revealed)

Log in to reveal hints progressively.

Complexity

Time O(n), Space O(n)

Common pitfalls

  • Removing valid pairs
  • Not handling all bracket types

Your solution

Log in to save your code and track progress.