can u pls send solution or explanation i mean logic
Unable to do ques
what we actually have to do in this question is:
- Put loop on string that will give substring of every length.
- create a function that will return true if the passed number is a CB number otherwise return false.
- To put a check if the digit is already a part of the any other CB number, create an boolean array say, valid which store which digits till now has been a part of any other CB number.
- Take a counter and increment if a CB number is found.
- At the end print the count.
I am showing you this for one iteration and you can do it for rest

As you can see we will get numbers like 23,3,35,357,3572
We have to check for these numbers are they cb number or not, and if they are we also have to check if the digit is already a part of the any other CB number or not
Also attaching code for same algorithm so that you can get a crystal idea for this problem
will it give all numbers
All cb numbers ? Yes it will.
ok you mean to say more less length string more/maximum numbers we would get, that’s we need not to check maximum for count ??? pls reply last for this .
I didn’t understood it, can you elaborate your doubt with an example?
Just dry run with the code i have provide. You will get the intuition for sure.
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.
Hi Shubham. Do u still have any query??
I see u have successfully submitted the code and got full points
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.