3
// checks whether the string word is a subsequence of s4
bool isSubSeq(string &s, string &word) {6
for (int i = 0; i < s.size(); i++) {7
if (s[i] == word[start]) {8
// every character of word occurs in s, therefore we return true9
if (++start == word.size()) {18
string findLongestWord(string s, vector<string> &dictionary) {20
for (string word : dictionary) {21
if (word.size() >= ans.size() and isSubSeq(s, word)) {22
if (word.size() > ans.size()) {24
} else if (word.size() == ans.size() and word < ans) {