problem
solution:
class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
unordered_set<string> tmp;
for(auto email:emails)
{
std::size_t at = email.find('@');
string local = "";
for(int i=; i<at; i++)
{
if(email[i]=='.') ;
else if(email[i]=='+') break;
else local += email[i];
}
tmp.insert(local+'@'+email.substr(at+));//errr...
}
return tmp.size();
}
};
参考
1. Leetcode_easy_929. Unique Email Addresses;
完