Solved Wordbreak problem II with DP method