You are viewing a single comment's thread. Return to all comments →
On Python this is ready solution. But on STL it's looks like:
//...
struct findin { const set<char>& sset_; findin(const set<char>& sset) : sset_(sset) {} bool operator()(char c) const { return sset_.end() != sset_.find(c); } };
string s1, s2; cin >> s1 >> s2; set<char> sset1(s1.begin(), s1.end()); set<char> sset2(s2.begin(), s2.end()); string answer( (sset1.end()==find_if(sset1.begin(),sset1.end(),findin(sset2))) ? "NO\n" : "YES\n");
Seems like cookies are disabled on this browser, please enable them to open this website
Two Strings
You are viewing a single comment's thread. Return to all comments →
On Python this is ready solution. But on STL it's looks like:
//...
//...