"5. In the case of a tied Hamming distance
(entirely possible), the winner will be chosen
by lottery among people with the best distance"
This says: don't take me seriously.Hopefully for their sake they get 1000s of people running implementations and by chance someone will get 19 and win. They won't even have the best algorithm, but it will test permutations randomly.
I wrote up a solution, but I prefer scratch off tickets.