Pergunta de entrevista da empresa LinkedIn

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?

Respostas da entrevista

Sigiloso

10 de ago. de 2011

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

5

Sigiloso

16 de jul. de 2011

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