Missing test cases

in the way i have taken substrings. if i find a cb number in a string of length lets say 4, i cross the indexes in my valid array. if the substring further consists of 2 or more cb numbers, then i am unable to acces them.

i have modified Your code

and commented the steps i have done
you can check

Modified Code

if you have any problem in this feel free to ask

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.