Hi, i was able to solve all cases but case 2. Please tell whats wrong with my code as my output is correct and only 1 case is not being marked correct

hi @akshat1409 dont change order
try abaa ans is a1b1a2 but u r printing all a once a3b
refer
https://ide.codingblocks.com/s/662074

can u please not use string concept and give solution

hi same way u can use character array @akshat1409 (btw string is just same as arrays)

why do we have i<s.length() and as a condition? answers are coming even without it by just using s[i] == ch

hi @akshat1409, that is the length of string u need to remain within length

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.