I am not getting required output. please check my code?

hello @shubham_jha

there are so many mistakes in ur code.

check ur updated code here->

but i would recommend u to solve this problem again from scratch.

ok, i will check again.

why are you explicitely creating string of size str2(10000,’\0’)?

string s;
will create an empty string, and u cannot use indexing on empty string.

thats why i created string by giving 10000 as its size and fill it with null value

why can’t we work with a empty string str2, i.e without giving size??

…

run this code and see what u are getting->

we cannt use indexing over emty string.

but u want to start from empty string then use push_back or insert function in place of indexing.

see this implementation , where we are not giving size

where to give feedback ??

wait i m sending the link

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.