I am getting TLE for test case 0 and 1

My code is https://ide.codingblocks.com/s/157351

Approach we need to follow to avoid any TLE’s
For length n (n pairs)

  1. if(openB > closeB) append β€˜)’
  2. 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