You are viewing a single comment's thread. Return to all comments →
Here is my simple C++ solution:
string twoStrings(string s1, string s2) { map<char,int> m1; for(int i=0;i<s1.size();i++){ m1[s1[i]]++; } for(int i=0;i<s2.size();i++){ if(m1[s2[i]]){ return "YES"; } } return "NO"; }
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 →
Here is my simple C++ solution: