CB Numbers question on string

Do we need to count repetition numbers or we need count only once if we have same numbers?

let us understand it through examples:

  1. n=“33” , this has only one CB number that is 3. ans = 1
  2. n=“331”, this has 2 CB numbers ={3,31}, ans =2

thanks
please rate and resolve if satisfied.

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.