FIND CB NUMBERS : Code not working for some test cases

Your code is not generating all the substrings. You need to maximize the number of CB numbers that can be formed by substrings of the given string. But your code won’t check all the substrings and won’t maximize the number of CB numbers.