Not getting correct answer

Please tell what is wrong with the code. I am getting 3 wrong answer for 3 test cases.

@sanyam_13 please provide your code in Coding Blocks IDE.

@sanyam_13 You are fixing the first and last position of the segment and then finding the number and checking it for the condition. It will not lead to optimal answer.
Eg number be 127, it will check for 1,then 12, then 127 now it full fills the condition, all of the numbers used now.
but their are 2 CB number possible, 2 and 7
You need to fix length(starting from len 1) then for all segment of that length check condition.


Here is a code for reference.
If this solves your doubt mark it as resolved.