unordered_set<string>isChecked;
bool isValid(string s, unordered_set<string>word)
if(isChecked.count(s)) return true;
if(!word.count(res)) return false;
else isChecked.insert(res);
string longestWord(vector<string>& words) {
unordered_set<string>word(words.begin(),words.end());
sort(words.begin(), words.end(), [](string a,string b){if(a.length() > b.length()) return true; else if(a.length() == b.length() && a<b) return true; else return false;});