Given an upper bound in array - elementsGroupItemsCount
, for example, which has 101 elements. How would I randomly select a minimum and maximum value from this range 0-100, where the minimum and maximum value are n numbers apart and need to contain n elements.
E.g. if the numbers need to be contain 6 elements, the following would be valid solutions:
- 5,10
- 12,17
- 19,24
I've seen how to generate random numbers in a range, but not sets of random numbers that are interrelated to each other.