Generate Parentheses

I think I have understood the problem right and have to make a solution for it, but it is showing the wrong answer when I submit. Please help me out the code is here link : https://pastebin.com/8X50nKTM

Your solution is right, just change parenthesis from β€˜{’ to β€˜(’ and β€˜}’ to β€˜)’.

1 Like

ohh mann… such a silly mistake and I got stuck for 4 hours.
Thanks for help

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.