Can you please check my code

i first thougth of making hello as helo
and then helllo as helo

Hello @sid.rajput23 please share your code by saving it on ide.codingblocks.com

i thought you were in collaborate mode

Hello @sid.rajput23 i have seen your code. you are not doing it in the correct way:
what you are doing is that you are checking for the continuous 2 only. but there can be more then 2 continuous characters.
you have to check for that as well.

yes sir later i have corrected it for that also

let me again check sir

you have to think the test cases like:
aaaabbccccaaaabcbacba
see in this as there are 4 continuous ‘a’ in the starting.
the output for that will be abcabcbacba

1 Like

check this:

done sir
in the first if case i added str[i] == str[i+1] && str[i]!=str[i-1]
then only cout<<str[i]

this is without recursion sir?
can we do problems without recursion?

@sid.rajput23 i have just given the approach:
do you want the same code with recursion?
i can write that for you? please confirm?

thank you sir but just please confirm that my submitted code is totally correct or any addition is required

@sid.rajput23 as i can see that your code is not able to score complete marks then yes your code is perfectally fine.
there is nothing required now.

1 Like

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.