Failed 1 test case

Hello Sir!

My program is failing one test case. Can you help me out.

Thanks.

Hi @prabhjots2k… pls share ur code… or u can refer this https://ide.codingblocks.com/s/590859

Ok, can you explain:
Line15: ch = i;
and Line 17: i–;

Thank you.

in line 15 ch = i stores the index of the position when we encounter a new character…
in line 17 i am doing i-- bcoz i have to start calculating from that index… u can remove i-- and just make count = 1 instead of count = 0… that will also have the same meaning

Okay.

Thank you sir.

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.