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.
[lower, upper], and you wantnnumbers between those 2 bounds? can you please make a more formal example? like a function prototype, a sample input, and the expected output?nto it to generate the second number? You'll just have to make sure that the first generated number is not to close to the end of the list.