字节跳动面试时的一到问题 给定一个字符串s和一个字典dict,判断字符串能否有字典中的字符串组成,字典中的字符串可以出现多次。 例如s=“Ilovebytedance”,dict={“I”,“love”,“bytedance”} 用动态规划,dp[i]表示字符串s[0~i]是否可分的bool值。 c++代码 bool wordBreak(string s, unordered_set<string> &dict) { int n = s.size(); vector<