小记录46

52 阅读1分钟

139.单词拆分

暴力法:每个位置找匹配单词然后increment index,如果 i === n 则返回 true

dp:dp[i] 的定义是当前位置之前的 substr 有匹配的