#!ruby -pl z=[] scan(/(.)-(.)/){|b|z=z.reject{|a|a-b!=a&&b|=a}<<b.sort} $_='%s %s'%z.minmax_by(&:size)
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page