You are viewing a single comment's thread. Return to all comments →
string twoStrings(string s1, string s2) { int freq1[26] ={0}; int freq2[26] ={0}; for(auto c:s1) { freq1[c-'a'] = 1 ; } for(auto c:s2) { freq2[c-'a'] = 1 ; if(freq1[c-'a']==1) 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 →