Sample Input
5
81615
Sample Output
2
in this the output is 2 which is considering 61 and 5 as the CB Numbers in the string but 8161 also satisfies all the condition for being a CB Number.
8161 is not divisible by any no’s in point 2.
Sample Input
5
81615
Sample Output
2
in this the output is 2 which is considering 61 and 5 as the CB Numbers in the string but 8161 also satisfies all the condition for being a CB Number.
8161 is not divisible by any no’s in point 2.
Hello @mikki18,
If you are wondering, why don’t they consider 8161 is not considered as a CB number:
You can consider it as a CB number instead of 61, it would work.
But, as you have to print the maximum CB numbers that can be created hat do not overlaps in terms of their position in the given number. (example: 61,5 or 8161 or 5),
You should look for the smallest CB number.
Reason:
It is possible that a CB number can itself be divided into more than one CB numbers.
Example:
44166181 is a CB number
but
41 and 61 are also CB numbers.
Hope, this would help.