the way i have found the substring it is correct or not
Https://ide.codingblocks.com/s/256664
For the input:
11
44166181111
The CB numbers are:
41
61
11
11
Your code gives CB numbers as:
11
Use long instead of int. Also, call a function that marks the index as visited for indexes which are part of that CB number.
Instead of creating a list and storing all the substrings, check for divisibility and availability of index for each substring
because if you create a list, you cannot check for availability of index
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.