Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 466 Bytes

File metadata and controls

25 lines (17 loc) · 466 Bytes

Problem 301: Remove Invalid Parentheses

Difficulty: Hard

Problem

Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.

Note: The input string may contain letters other than the parentheses ( and ).

Example

Example 1:
Input: "()())()"
Output: ["()()()", "(())()"]

Example 2:
Input: "(a)())()"
Output: ["(a)()()", "(a())()"]

Example 3:
Input: ")("
Output: [""]