count_triples function

Count number of triples of overlapping lists