Constrain the number of occurrences in an array

In reply to diptishe:

The result of all the equality/relational/logical operators are all 1-bit 1’b1 or 1’b0. The result of the sum() method has the same type as each element.