neither<T> static method
Calculates the number of elements in neither set (relative to universal).
Formula: |U| - |A ∪ B|
Example:
final universal = CustomSet<int>([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
final a = CustomSet<int>([1, 2, 3, 4]);
final b = CustomSet<int>([3, 4, 5, 6]);
print(CardinalityUtils.neither(a, b, universal)); // Output: 4
Implementation
static int neither<T>(
CustomSet<T> a,
CustomSet<T> b,
CustomSet<T> universal,
) {
final unionCard = unionCardinality(a, b);
return universal.cardinality - unionCard;
}