The problem explained in this video does not work on every word

If my input string is “hello” then it skips the important letter which create the word.

So can you give me an program which removes the consecutive duplicate letters without changing that actual word?

hello @Shivam01 here is the correct code for the question you mentioned above .


if you have any confusion any line please ask here .
if your doubt is cleared please mark this doubt as resolved .
Happy Learning !!

It’s giving me the same output.

I am asking that if if input is word is “hello” then can it give me “hello” as output.

Because if we change this string by removing the consequence duplicate characters then it change the actual word which I don’t want do.

Also explain your previous code by giving code explaination by writing comments on each line.

hello @Shivam01 you want the same string which you take input to be printed back in the output ?
right?
please confirm and if this is not the case please elaborate yourself i am unable to understand .
Happy Learning !!

hey @Shivam01 have you read about recursion ?

yes I know basics of recursion

if you know about recursion then i have simply performed the recurson function with condition .
there is nothing major in the function rather than recursion.
if you still have any doubt please ask here and if you feel that your doubt is cleared you can now mark this doubt as resolved and do hit the like button .
Happy Learning !!

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.