Oh and there is a third restriction:
- all tuples for which B >= X should be part of the subset
Oh and there is a third restriction:
- all tuples for which B >= X should be part of the subset
The answer by the way was very simple: sort by descending density and loop over each item. Try to add id to the subset and if the average amount of B remains above X keep it added. If it isn’t, skip it and try with the next item until you went through all of them