: count-item ( seq item -- n ) [ = ] curry count ; : occurence ( seq^2 seq -- counted-seq^2 ) ! only 1 and 0 in our case, because most-items is pruned swap [ [ count-item ] with map ] with map ; : occurs-enough?-map ( seq^2 seq -- appeared^2 ) occurence [ [ sum ] [ most-is-n ] bi >= ] map ; : most-in-common ( seq^2 -- have-most-in-common ) [ ] [ dup most-items occurs-enough?-map ] bi zip [ dup second t = [ first ] [ drop f ] if ] map sift ;