Finding cb number

can anyone explain the above questin i did not get it completely

Hi Ankush, read the description of the question 2-3 times for a better understanding of the question.
The description states:

Deepak and Gautam are having a discussion on a new type of number that they call Coding Blocks Number or CB Number. They use following criteria to define a CB Number.

0 and 1 are not a CB number.
2,3,5,7,11,13,17,19,23,29 are CB numbers.
Any number not divisible by the numbers in point 2( Given above) are also CB numbers.
Deepak said he loved CB numbers.Hearing it, Gautam throws a challenge to him.

Gautam will give Deepak a string of digits. Deepak’s task is to find the number of CB numbers in the string.

CB number once detected should not be sub-string or super-string of any other CB number.
Ex- In 4991, both 499 and 991 are CB numbers but you can choose either 499 or 991, not both.

Further, the CB number formed can only be a sub-string of the string.
Ex - In 481, you can not take 41 as CB number because 41 is not a sub-string of 481.

As there can be multiple solutions, Gautam asks Deepak to find the maximum number of CB >numbers that can be formed from the given string.

Deepak has to take class of Launchpad students. Help him by solving Gautam’s challenge.

Basically CB numbers are prime numbers and you have to find the maximum number of CB numbers that can be formed from the string satisfying the given conditions.

For example, for the given sample input:

81615

The answer is 2 because there are two prime numbers in 81615 i.e. 8161 and 5.

Hey Ankush, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

Please check my code once, It is passing all test cases except 3. Please help me to solve this

#include
#include
#include<math.h>
using namespace std;
bool isPrime(int a){
if(a == 1 || a == 0){
return false;
}
if(a == 2){
return true;
}
for(int i=2;i<=sqrt(a);i++){
if(a % i == 0){
return false;
}
}
return true;
}
int main(){
int n;
cin>>n;
string s;
cin>>s;
int count = 0;
for(int i=0;i<n;i++){
for(int j=i;j<n;j++){
string temp = “”;
for(int k =i;k<=j;k++){
temp += s[k];
}
if(isPrime(stoi(temp))){
// cout<<temp<<endl;
count++;
i = j;
break;
}
}
}
cout<<count<<endl;
return 0;
}

can you plz clear my doubt ?