Word Break [ IBM – Google ]

Problem:

Given an input string and a dictionary of words, find out if the input string can be segmented into a space-separated sequence of dictionary words. See following examples for more details. Consider the following dictionary
{ i, like, sam, sung, samsung, mobile, ice,cream, icecream, man, go, mango}

Input:  ilike
Output: Yes
The string can be segmented as “i like”.

Input:  ilikesamsung
Output: Yes
The string can be segmented as “i like samsung” or “i like sam sung”.

Problem Link

 

Comments are closed.