1class Solution {2public:3void uncommon(string s, unordered_map<string, int> &mp) {4string word = "";5for (int i = 0; i < s.size(); i++) {6if (s[i] == ' ') {7mp[word]++;8word = "";9} else {10word += s[i];11}12}13mp[word]++;14}15vector<string> uncommonFromSentences(string s1, string s2) {16vector<string> ans;17unordered_map<string, int> mp;18uncommon(s1, mp);19uncommon(s2, mp);20for (pair<string, int> p : mp) {21if (p.second == 1) ans.push_back(p.first);22}23return ans;24}25};