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


in reply to Re^9: Words in Words
in thread Words in Words

The last version of my script with the sort by length optimisation is broken. It starts each search into the big string in slightly the wrong places. Hence why it doesn't find as many words as it should. It could be fixed, but it will never be as quick as your approach.

More intriguing is if your list contains 'indistinguishablenessess', & 'indistinguishableness', why doesn't yours output the latter? I didn't expend any time on it, but I couldn't see how it could miss.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^11: Words in Words
by choroba (Cardinal) on Oct 02, 2011 at 08:45 UTC
    Oh sorry, I missed the last "-ess". The longer words is not in the list. Also, I ran a bit different versions of your code on the two machines, hence the different behaviour. Anyway, it was a funny challenge :-)