Solving Remove Invalid Parentheses in Javascript. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

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 1:

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

Example 2:

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

Example 3:

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

See the full details of the problem Remove Invalid Parentheses at LeetCode

Originally posted at: @github.com/ignacio-chiazzo/Algorithms-Leetcode-Javascript