行业知识
Leetcode 139.单词拆分
2026-11-25 16:38:34
来源:互联网转载
OJ�index.php/tags-41973.html" >�接 :139.单词拆分
代码:
class Solution { public boolean wordBreak(String s, List wordDict) { Set set = new HashSet(wordDict); int n = s.length(); boolean[] dp = new boolean[n+1]; dp[0] = true;//初始化 保证后边正常 s = " " + s; //映射 for(int i =1;i