Solved word break problem with DP method