动态规划13(Leetcode139单词拆分)

代码:

class Solution {
    public boolean wordBreak(String s, List wordDict) {
        Set wordDictSet = new HashSet(wordDict);
        boolean[] dp = new boolean[s.length()+1];
        dp[0] = true;
        for(int i=1;i<=s.length();i++){
            for(int j=0;j

你可能感兴趣的:(动态规划,算法)