here why sir has not taken the condition for a[prev]==a[current];
explain it
Duplicate character
hi rahul,
prev is a pointer which is keeping track of last distinct character and if a[prev] == a[curr] then we dont have to do anything and just skip it.
Please let me know if there is any other doubt.
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.