http://qs1969.pair.com?node_id=281453


in reply to Re: Detecting transpositions
in thread Detecting transpositions

Or even shorter... Albeit about 3 times slower on long strings and 30% faster for short...
sub comp { local $_ = $_[0] ^ $_[1]; return s/([^\x00])\1//g==1 && !tr/\x00/1/c; }


T I M T O W T D I