hamming on ruby iteration 2