当前位置 : 主页 > 手机开发 > harmonyos >

leetcode-139-Word Break

来源:互联网 收集:自由互联 发布时间:2023-08-26
Error: cannot solve it. Use recursion to do this, func(s, word_map, word_set) check if current string s can word break or not. And word_map store intermediate result. In the function, check if left substring s is within the word_set and rig


Error:
cannot solve it. Use recursion to do this, func(s, word_map, word_set) check if current string s can word break or not. And word_map store intermediate result.

In the function, check if left substring s is within the word_set and right substring is able to word break or not. I.e., check word_set.find(left(s, p, len)) && func(s.substr(p+len), word_map, word_set);


上一篇:leetcode-236-Lowest Common Ancestor of a Binary Tree
下一篇:没有了
网友评论