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
相關文章
相關標籤/搜索