Count the Overlap by Histocrat

#!ruby -na
i=$F.map &:to_i
a,b,c=[1,9,17].map{|n|x,y=[n,n+2].map{|o|[*i[o]...i[o]+i[o+4]]};x.product y}
puts %w[ab ac bc abc].zip([a&b,a&c,b&c,a&b&c].map &:size)*' '

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page