atLeastOne<T> static method

int atLeastOne<T>(
  1. CustomSet<T> a,
  2. CustomSet<T> b
)

Calculates the number of elements in at least one of the sets.

This is equivalent to the union cardinality.

Example:

final a = CustomSet<int>([1, 2, 3, 4]);
final b = CustomSet<int>([3, 4, 5, 6]);
print(CardinalityUtils.atLeastOne(a, b)); // Output: 6

Implementation

static int atLeastOne<T>(CustomSet<T> a, CustomSet<T> b) =>
    unionCardinality(a, b);