Think about the task: how many "contiguous fragments" of the input number are there?

The minimum size of a fragment is 2 (or it's not divisible by 11) and the maximum is the whole number length of 7 (or if that is not allowed then one less - 6)

Which means that all the contiguous fragments are:

C#

12, 21, 15, 55, 59, 98, 121, 215, 155, 559, 598, 1215, 2155, 1559, 5598, 12155, 21559, 15598, 121559, 215598, 1215598They are easy to work out with a pair of nested loops.

Then all you have to do is check each fragment for divisibility, and that's trivial: the modulus operator "%" will do that for you!

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!

I need to break it up in fragments