Reputation: 11
I have a list of 5 items. I need to generate a list with 3 items equal to 4 and 2 others equal to 2. how to generate it?
my code was :
my_list : list of uint;
gen my_list keeping my_list.count(it==4) = 3;
but i got syntax error for it
Upvotes: 1
Views: 39
Reputation: 129
I think, you want:
gen my_list keeping { it.is_a_permutation({4;4;4;2;2}) };
Upvotes: 0