Correct the code

please send this problem solution using a output string

Hey @Lovishbansal
Do u want me to rectify ur errors or send u a new code?

Just initalize ur string in main with 2*n characters :

string output(2*n,’ ');

sir please send the code

Hey @Lovishbansal
I already told u the change u have to do

not working after the changes

so sir please send the code…

it shows blank output

Only changed that line …

sir why only string output is not working

Because in recursion u are trying to access output[idx] but ist not initalized ,so thatswhy not working

Thanks a lot sir :pray: :pray: :pray:

1 Like

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.