ruby/hamming 2nd iteration