leetcode 30:与所有单词相关联的字串

首先计算出words中所有的元素所合成的字符串的长度len,s的下标每次往后移动一位,每移动一位,从s中取出len个字符构成字符串判断是否由words组成 bool compare(std::string str,std::vector<std::string> &words,std::vector<int> b){ int i=0; int c=0; int flag=0
相关文章
相关标签/搜索