Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution
- {
- public:
- int countWords(string list[], int n)
- {
- map<string,int>mp;
- for(int i=0;i<n;i++)
- {
- mp[list[i]]++;
- }
- int count=0;
- for(auto u:mp)
- {
- if(u.second==2) count++;
- }
- return count;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement