You are viewing a single comment's thread. Return to all comments →
using namespace std;
int main() { int p; cin >> p;
while(p--) { string s1,s2; cin >> s1 >> s2; bool flag = false; for(int i=0;i<s1.length();i++) { char c =s1[i]; if(s2.find(c)!=string::npos) { flag=true; break; } } if(flag) cout << "YES" << endl; else cout << "NO" << endl; } return 0;
}
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 →
include
include
using namespace std;
int main() { int p; cin >> p;
}