Finding CB Numbers sample output doubt

int the number 81615, prime numbers are 5,61 and 8161. so the answer should be 3 and not 2!

HI @zodiac, this is because we can include one digit to one number only.
Acc to ur logic, 6 and 1 are used twice once in 61 and then in 8161, which is not to be done. And hence, ans is 2 AND NOT 3. The goal is to generate maximum CB numbers from given number.

Hope this helps :slight_smile:

1 Like