jeudi 8 avril 2021

Choose a n number of elements randomly from an array that combined to a (predefined)total sum [closed]

I have a bank of questions from which I wanna choose n number of questions whose total would be m, but I want my system to randomly choose question for the user. Each questions could be of different marks.

I'm looking for an algorithm that can do this for me. Currently I have randomized the order of array but unable to set the new list properly.




Aucun commentaire:

Enregistrer un commentaire