lundi 5 avril 2021

choose random block of numbers without repetition

I have a list of numbers from 1 to 100. I need to choose a block of numbers of a random size. For example, first time choose number 5 to 21 second time choose number 50 to 66 Continue choosing a block of numbers until all numbers have been chosen, i.e., I cover the whole range (which is 100). The numbers should not be repeated in any block, meaning that the ranges should be unique.

I need a general algorithm not related to a specific programming language.




Aucun commentaire:

Enregistrer un commentaire