isDisjoint<T> function

bool isDisjoint<T>(
  1. Set<T> a,
  2. Set<T> b
)

Disjoint Check: returns true if a and b have no elements in common.

Example: isDisjoint({1, 2}, {3, 4}) => true

Implementation

bool isDisjoint<T>(Set<T> a, Set<T> b) => a.intersection(b).isEmpty;