in some of the test cases TLE is coming
Generate parenthesis
@pearlgupta2000
Yes you will get TLE, because you are generating all possible permutations, and then checking for each string if it is valid or not.
You have to generate only valid parenthesis.
Please refer this code: o denotes opening brackets, c denotes closing brackets.