What is the right way to split a string into words ? (string doesn\'t contain any spaces or punctuation marks)
For example: \"stringintowords\" -> \"String Into Word
Actually, with the dictionary this problem can be solved in O(n) time. More precisely in (k + 1) * n at worst, where n is the number of characters in the string and k is the length of the longest word in the dictionary.
Besides, the algorithm allows you to skip junk.
Here's the working implementation in Common Lisp I've created some time ago: https://gist.github.com/3381522