• + 0 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";
    }