CB numbers test case failing

my code is here I don’t know what I am missing
https://ide.codingblocks.com/s/72137

Some test cases are still failing

Can anyone help me in this?

dhiraj see the constraint
string can be of length 17 but u have taken valid array of 10

still its not working

Can somebody please help me in this?

Dhiraj
u r checking for like
like string =abcxyz
a,ab,abc,abcx,abxy,abcxyz the b,bc
take a string abcxyz
where abcxyz is a cb number and b,c,d,x… ar CB number
so u got ans 1
so check for the smallest possible cb number which of length 1 then lenght 2 and so on
and also the length of the string is 17 only there will be no TC problem
and u can make a bool array to check wheather that part is taken or not
HOPE this help:)
For code repply

Could not understand what did you say

dhiraj u are searching length wise increasing CB number like
string abcxyz
then u are checking a ab abc abcx abcxy abcxyz
but u have to search for lowest length first like
a,b,c,x,y,z then ab lenght 2 then lenght 3 etc
to unserstang
like abcxyz
if abcxyz is a CB number and b,c,x are CB number then ur output will be 1 but and =3
hope this help
if this not help then reply i will send u code