Re: Finding the common textual denominator
On Sunday 06 March 2005 12.39, Olle Eriksson wrote:
> <snip>
> If I want a generic algorithm? No, not in the sense that it should find
> anything in common between the strings. I should have been more clear
> on that. It is well enough to find only the common beginnings of the
> strings. So with Joey Hess' example above it would return either
> nothing, if using forward iteration beginning at the top, or even
> better return "Eric_Clapton" in one word if it could be that smart. And
> it should treat white space as just another character.
>
> An example:
>
> aa bbbcc
> bb bccdd
> bb bbcdd
> bb bbbdd
>
> ..should return either "", or "bb b" (even better).
I'm going to have to correct myself. Of course the above example should
return "" (nothing) since there is no common denominator beginning these
text strings. With the one starting with "aa", it should return "bb b".
Olle
Reply to: