Just another Perl shrine | |
PerlMonks |
Re: Re: Optimizing a string processing subby spurperl (Priest) |
on Jan 09, 2003 at 06:00 UTC ( [id://225455]=note: print w/replies, xml ) | Need Help?? |
I meant the latter, and your solution works well (see my 2nd reply to dragonchild above for some clarifications).
It also feels "right". The problem is when some char X appears in word2 and then twice in word1... Using a hash is a clever solution to this problem. I've been trying to run your algorithm on some examples, and in my head, and didn't break it yet. It also works about 50% faster than my original version.
In Section
Seekers of Perl Wisdom
|
|