ruby hamming 1 iteration