#!/usr/bin/env ruby # frozen_string_literal: true ARGF.each_line.lazy.flat_map{|l|l.downcase.split /\W+/}.reject(&:empty?).each_cons(3).reduce(Hash.new(0)){|a,e|a[e.join' ']+=1;a}.sort_by{|_,v|-v}[0..99].each{|c|puts [c[1],c[0]]*' - '}