In problem of leetcode if two strings are close I got solution as
class Solution {
unordered_map<char, int> m1;
unordered_map<char, int> m2;
set<char> sc1;
set<char> sc2;
multiset<int> s1;
multiset<int> s2;
public:
bool closeStrings(string word1, string word2) {
ios_base::sync_with_stdio(false);
if(word1.size() != word2.size()) return false;
for(auto& x : word1) m1[x]++;
for(auto& x : word2) m2[x]++;
for(auto it = m1.begin(); it != m1.end(); it++) {
sc1.insert(it->first);
s1.insert(it->second);
}
for(auto it = m2.begin(); it != m2.end(); it++) {
sc2.insert(it->first);
s2.insert(it->second);
}
return sc1 == sc2 && s2 == s1;
}
};
as this code. what does the == sign checks ?Thank u all in advance
Pls make me understand the use of this operator
New contributor
Anubhab anu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.