From: Martin DeMello Date: 2007-01-12T01:26:57+09:00 Subject: Re: [SUMMARY] Word Blender (#108) On 1/11/07, James Edward Gray II wrote: > On Jan 11, 2007, at 7:54 AM, Martin DeMello wrote: > > I used a different signature method - I mapped each unique letter in > > the target word to a prime, and then used the product of the primes of > > all the letters in a word as its signature. That way, a is contained > > in b if signature(b) % signature(a) == 0, and you can generate the > > signatures via each_byte, array lookup and integer multiplication (no > > need for split, sort or string deletion). > > Very interesting. I've never seen that before. I like it. The numbers overflow 32 bits in the general case, I think, but for this restricted problem it works very nicely. martin