this was easy
ruby hamming
switched to awesome algorithm thanks to @etrepum