containsHits<E> function

int containsHits<E>(
  1. Iterable<E> listA,
  2. Iterable<E> listB
)

Count of items that hit both lists

Implementation

int containsHits<E>(Iterable<E> listA, Iterable<E> listB) {
  int hits = 0;
  for (final E element in listB) {
    if (listA.contains(element)) {
      hits++;
    }
  }
  return hits;
}