For a list of elements, how many ways are there to make X groups of Y continuous elements? E.g.
2 groups of 2 elements for this list:
1 2 3 4 5
There are 3 ways:
Is there a closed form way to compute this? Typical combination/permutation forumulas don't seem to apply because some choices of early elements aren't valid (if we choose (3,4) then we can't make a complete second group, choosing (1,2) would just be a duplicate of the earlier solution).
Any help is appreciated!