You should be able to use a PackedInts.Mutable directly here since the maximum value is already known.