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. SQL Server 默认跟踪(Default Trace)介绍使用

    背景 当数据库的表.存储过程经常别修改,当这些修改造成BUG的时候,很多开发都不承认是他们干的,那我们有没办法找出谁干的呢? SQL Server有Default Trace默认跟踪,数据库记录信息到 ...

  2. BlockingCollection<T> 类实现 列队操作

    官方文档 为实现 IProducerConsumerCollection<T> 的线程安全集合提供阻塞和限制功能. 通过 BlockingCollection<T> 实现列队调 ...

  3. win10 安装Borland C++Builder 6后编译运行出

    win10系统安装bcb后打开bcb后显示 Unable to rename ‘c:\Program Files(x86)\Borland\CBuilder6\Bin\bcb.$$$'to‘cc:\P ...

  4. [SCOI2016]妖怪

    嘟嘟嘟 离NOI最后一周,把自己容易忘的知识点和板子复习一下. (刚答完loj的笔试模拟,感觉上不了90--) update:哦,我89-- 先把式子写出来,每一个妖怪的战斗力\(S(i) = A + ...

  5. 微信小程序微信登录

    开发接口 登录 wx.login wx.checkSession 签名加密 小程序登录 小程序可以通过微信官方提供的登录能力方便地获取微信提供的用户身份标识,快速建立小程序内的用户体系. 登录流程时序 ...

  6. js 的数组怎么push一个对象. Js数组的操作push,pop,shift,unshift JavaScrip

    push()函数用于向当前数组的添加一个或多个元素,并返回新的数组长度.新的元素将会依次添加到数组的末尾. 该函数属于Array对象,所有主流浏览器均支持该函数. 语法 array.push( ite ...

  7. OSPF外部实验详解

  8. FLUENT不同求解器离散格式选择【转载】

    转载自:http://blog.163.com/wu_yangfeng/blog/static/16189737920104158950438/ 离散格式对求解器性能的影响 控制方程的扩散项一般采用中 ...

  9. C前序遍历二叉树Morris Traversal算法

    首先来递归算法,简单易懂: #include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef ...

  10. Oracle备份的几种方式

    这里使用Oracle 12C来大概演示说明一下rman的基本用法,这里不会深入讨论,因为本人也只是刚刚才接触,只是结合了网上的一些文章以及自己的实践来总结并拿出来大家学习,谢谢 目录 一.关于备份与恢 ...