Converting substring into integer for the operation


Can you help me with the error? Thanks !!

Hey @Mayank2096,
I think you misunderstood the question.

You can use the following approach:
Check for all sub-strings of the given string of digits, starting from the all strings of length 1 and then gradually checking for the strings of increasing size:

Check if the sub-string is CB number: for this, create a function. If sub-string is 1 or 0 return false. If sub-string is any of the {2,3,5,7,11,13,17,19,23,29}, then return true. If sub-string is divisible by any of the {2,3,5,7,11,13,17,19,23,29}, then return false. Else return false

Now if it is a substring: call a function that marks the index as visited for indexes which are part of that CB number. Increment the count for CB number.
Print the count

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.