Suppose I have an array like
0 1 1 1 0 0 0 0 1 0
0 0 1 0 0 1 0 0 0 0
1 0 0 0 0 1 0 0 1 0
I want each row to have a specific number of ones- let's say, 5 ones per row. So in the first row I need to add 1 one, second row needs 3 ones, and the third needs 2. I need to randomly generate those ones in places where x = 0.
How do I do this?
Aucun commentaire:
Enregistrer un commentaire