How to approach CB numbers?

I am able to figure out how to solve this problem.

Hi @sarthakj2099

You can check for each substring of the string and convert it to integer. If that substring is a cb number then you can increase the count and make your pointer point on the next letter after the last letter of the substring. You can do this greedily with trying smallest size of the substring going from left to right, then so on.

Hope it Helps.

@sarthakj2099
Please mark your doubt as resolved.

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.