I have a list of formulas for combining elements:
A + B + C = X D + E + F = Y G + H + I = Z
I want to make sure that for any random 4 elements there will never be more than 1 applicable formula. For example, the formulas below should not be allowed as if I were getting the elements A, B, C and D, then both are applicable:
A + B + C = X B + C + D = Y
Each formula will consist of 3 elements on the LHS, and LHS - to include the rule. Items are sorted if this helps.
Alternative, equivalent problem:
I have a list from an array of three elements: List<Element[3]> How can I guarantee that there are no two elements in several arrays.
What would be efficient enough (execution speed) for this for a large number of elements and a large number for formulas (except for rough forcing)?
source share