class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
set<string> real;
for(string c:emails){
auto itat = c.find('@',0);
auto itplus = c.find('+',0);
c.erase(itplus, itat - itplus);
for(auto it= c.begin();it != c.end();it ++){
if(*it == '@')
break;
if(*it == '.' )
c.erase(it);
}
real.insert(c);
}
return real.size();
}
};
leetcode929. 独特的电子邮件地址 c++
猜你喜欢
转载自blog.csdn.net/qq_23905237/article/details/86531421
今日推荐
周排行