In passing the reference

When value of i=2 j=1 is a,b,\0,\0 then in next step when i=3 j=2 how do we have value of output array a,c,\0,\0

@pranjuldwivedi120568 when you have ab there will be two conditions next time i+1,j+1 and i+1,j so in i+1,j j remains at 1 so ab becomes ac
for better understanding remove b
when string is a you have to options include b or not
if include it becomes ab else a
now for a there are two options include c or not
so if include it becomes ac

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.