write word_chains.rb
word_chains.rb: find 10x speedup