Remove Invalid Parenthesis
hard
1. You are given a string, which represents an expression having only opening and closing parenthesis. 2. You have to remove minimum number of parenthesis to make the given expression valid. 3. If there are multiple answers, you have to print all of them. Note -> Check out the question video and write the recursive code as it is intended without changing signature. The judge can't force you but intends you to teach a concept.
Constraints
1 <= length of string <= 20
Format
Input
A string containing only opening and closing parenthesis
Output
Print all the Valid expressions. Check the sample ouput and question video.
Example
Sample Input
()())()
Sample Output
(())()
()()()
Question Video