I am trying to go through the iteratively
how to take of output array to fill the null value
Recursion duplicate String Formatting
the loop should run upto n-2 index as you are accessing (i+1)th index. and out[100] will not run for larger test cases.
I resolved the issues.
updated code: https://ide.codingblocks.com/s/212729
thanks
in worst case, there can be * after every character in out. so size of out will never exceed 2n.
please rate and resolve if satisfied.
thanks
@gauravshukla789 yes for ex aaaa then size is 5 and the character( * ) is 3 need so the size will be 5+3=8 so approx we can take the 2*input(size) right ?
And also one more thing is that which approach is really correct way of doing creating an extra or the below one.?
yes that’s true. I would say first way is always recommended. in this question both ways are fine.
in competitive world, there are questions which don’t want you to print anything, they ask to return the result. so storing the result is recommended.
thanks
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.