problem

929. Unique Email Addresses

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;

完

【Leetcode_easy】929. Unique Email Addresses的更多相关文章

  1. 【leetcode】929. Unique Email Addresses

    题目如下: Every email consists of a local name and a domain name, separated by the @ sign. For example, ...

  2. 【LeetCode】929. Unique Email Addresses 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 set + 字符串操作 参考资料 日期 题目地址:h ...

  3. 929. Unique Email Addresses

    929. Unique Email Addresses Easy 22766FavoriteShare Every email consists of a local name and a domai ...

  4. [leetcode] 929. Unique Email Addresses (easy)

    统计有几种邮箱地址. 邮箱名类型:local@domain 规则:1. local中出现"."的,忽略. a.bc=abc 2. local中出现"+"的,+以 ...

  5. [LeetCode] 929. Unique Email Addresses 唯一的电邮地址

    Every email consists of a local name and a domain name, separated by the @ sign. For example, in ali ...

  6. [LeetCode] 929. Unique Email Addresses 独特的邮件地址

    Every email consists of a local name and a domain name, separated by the @ sign. For example, in ali ...

  7. LeetCode 929.Unique Email Addresses

    Description Every email consists of a local name and a domain name, separated by the @ sign. For exa ...

  8. LeetCode 929 Unique Email Addresses 解题报告

    题目要求 Every email consists of a local name and a domain name, separated by the @ sign. For example, i ...

  9. LeetCode 929. Unique Email Addresses (独特的电子邮件地址)

    题目标签:String 题目说明 有两个规则针对于 local name. 所以先把local name 和 domain name 分开. 两个规则是: rule 1:'.' 会被去除. (利用re ...

随机推荐

  1. 学习Spring-Data-Jpa(一)---JPA、Spring-Data-Jpa简介

    写在前面:在国内使用比较多的ORM框架应该就是Mybatis了,但是现在SpringBoot和SpringCloud这么火爆,而Spring-Data-Jpa同样作为Spring家族的成员,它们无缝的 ...

  2. Oracle 异步IO 优缺点

    一.Oracle在Linux下使用异步IO配置 最近在测试Oracle的时候,很想测试下使用异步IO的性能.但是异步IO是需要专门配置的,否则的话,容易遇到很著名的“ORA-01578: ORACLE ...

  3. win32线程栈溢出问题 (一)

    一.什么是线程栈溢出 我们都知道,每一个win32线程都会开辟一个空间,用来临时存储线程执行时所调用的一系列函数的参数.返回地址和局部变量及其他上下文信息.这个空间就是线程的栈区.栈区的容量是有限的, ...

  4. 转 Storm JAVA_HOME is incorrectly set.

    问题可能有两个原因: 1.在环境变量中未设置JAVA_HOME变量名称. 解决办法: 在环境变量中添加. 或者在storm中的bin文件下有一个storm-config.cmd,使用文本打开,查询JA ...

  5. java书籍推荐[转]

    作为Java程序员来说,最痛苦的事情莫过于可以选择的范围太广,可以读的书太多,往往容易无所适从.下面就按照学习顺序,给大家推荐下面这些JAVA书籍.一.Java编程入门类,选择大于努力,入门太重要.对 ...

  6. 历史相关API

    一.history对象 ①history.back()移动到上一个访问页面,等同于浏览器的后退键. ②history.forward()动到下一个访问页面,等同于浏览器的前进键. ③history.g ...

  7. phpize是干嘛的

    安装php(fastcgi模式)的时候,常常有这样一句命令:/usr/local/webserver/php/bin/phpize一.phpize是干嘛的?phpize是什么东西呢?php官方的说明: ...

  8. lixuxmint系统定制与配置(2)-输入法

    小书匠Linux RIME的官网在这里 1.安装 刚开始是使用ibus-rime,后来使用过程感觉不舒服,就换回fcitx-rime.使用以下命令安装fcitx-rime sudo apt insta ...

  9. OpenStack RPC框架解析

    1  消息队列Rabbitmq介绍 Rabbitmq的整体架构图 (1)Rabbitmq Server:中间那部分就是Rabbitmq Server,也叫broken server,主要是负责消息的传 ...

  10. Android Studio导入google training example gradle失败

    Error:Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request 每次从github的Google ...