My code is https://ide.codingblocks.com/s/157351
I am getting TLE for test case 0 and 1
Approach we need to follow to avoid any TLEβs
For length n (n pairs)
- if(openB > closeB) append β)β
- if(openB < n) that is we can append more β(β irrespective of how many β)β have been added, append β(β.
Base case:
if(closeB == n) , print the formed string.
Thats it!
Please have a look at this very short code to see implementation for this.
For ease, we use strings. Strings are passed as value. So just go with them!
Thereβs no need to have vectors, append and delete or anything.
Ok , I got it. I think I require some more practice to get it the right way!
thank you