Please explain this question to me…the part I dont understand is the one with 4991- 499 and 991.
Finding CB numbers
Hello @Doctor_Insult,
In the above example 4991.
There are two CB numbers possible i.e. 499 and 991.
But, 499 and 991 uses the same digits 99 (or index i.e. second and third) of the given number 4991.
In simple words, 499 and 991 uses overlapping index/ digits of original number.
Thus, only one of them would be considered as CB number.
Hope, this would help.
Give a like if you are 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.
Suppose their is a 17 digit number which is a CB number. How will I store and operate on it?
@Doctor_Insult store them as strings and operate on the substrings. You can use stoi() function for string to int conversion and to_string() for string to int.