Hardware interview practice
Enforce uniqueness within each group
Randomize group and ID arrays so items in the same group always have different IDs.
Reviewed example
Work through one case
Input
two groups of three values, legal values 0..9Expected output
One valid randomized result: group0=[1,4,7], group1=[0,5,9]Values are unique within each group. Cross-group reuse would remain legal if the constraint is intentionally scoped per group.
What to cover
Requirements
- Groups may be 0 or 1.
- IDs may range from 0 through 255.
- The same ID may appear once in each different group.
