Constraint number of occurrences in dynamic array

In reply to Blitzz0418:

Assuming you meant to write
arr.sum() with (item==3) == 3*4
, that would be interpreted as there must be exactly 12 elements in arr the element value is 3.

Perhaps you can show some solutions values sets you are looking for.