Output is repeating please help remove duplicate character

Output is reapeating iteself and also I feel my code is incorrect in base as well as recursive case

image
move it in the else block

3 test cases are coming wrong

while(a[i+1] != ‘\0’ and a[i]==a[i+1]){ i+=1; } what does 1st condition do and why did we use i+=1

and also dont we need to check previous element of is equal or not

understood thanks we skip 1st reapeating element and take 2nd into consideration

1 Like

Great @rastogi.g1998