Getting testcases failed..whats the mistake?

if(a[l+1] != ‘\0’ and a[l]==a[l+1])…i dont understand this condition…why are we first comparing the last alphabets?

also what is wrong with my approach?

checking if l+1 exists or not …

i am basically not updating a+1