LinkedIn Interview Question

Segment a long string into a set of valid words using a dictionary. Return false if the string cannot be segmented. What is the complexity of your solution?

Interview Answers

Anonymous

Aug 10, 2011

Better yet, read my blog. This question has been retired. thenoisychannel.com/2011/08/08/retiring-a-great-interview-problem/

5

Anonymous

Jul 16, 2011

Use dynamic programming, search for string segmentation online. Worst case complexity is 2^N.