You are viewing a single comment's thread. Return to all comments →
Here is my simple c++ solution, video explanation here : https://youtu.be/xwLiYvExM6I
string twoStrings(string s1, string s2) { map<char, int>mp; for(int i = 0; i < s1.size(); i++) mp[s1[i]] = 1; for(int i = 0; i < s2.size(); i++){ if(mp[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, video explanation here : https://youtu.be/xwLiYvExM6I