http://www.perlmonks.org?node_id=712526


in reply to Re: Challenge: "Words" In A String
in thread Challenge: "Words" In A String

ikegami,
I am not sure when I will get a chance to decipher this but thank you. My unfinished solution is derived from the code I wrote here.

Another idea I had but passed on was a two pass approach. The first pass would mark where each word in the dictionary overlapped the target word. The second pass would use a heuristic approach to a variation of the bin packing problem. I abandoned it because it seemed unnecessary given the expected length of input strings would usually be less than 30 characters and contain 2 to 3 words from the dictionary.

Cheers - L~R