hamming on ruby iteration 3