Advice needed on the approach used,TLE IN OP


Is my approach wrong if not can you please tell me modification to be done in same program
Thank you

also im very confused whether to use seperate array to store op or not thats why i think my base case is wrong

please tell me when should be use seperate op array and whe we should not

see first of alll
try using as much of string as u can
char* is little confusing
use a separate string when update has to be made in between in the string
like adding another character b/w existing elements

here
u can simple swap the value when x is found

but is this recursive approach

i dont see no recursive function call
this code is iterative…

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.