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. SPA项目开发动态树、数据表格、分页功能

    SPA项目开发 1.修改左侧动态树 LeftNav.vue <template> <el-menu router :" class="el-menu-vertic ...

  2. 013——MATLAB硬件支持包离线下载

    (一)参考文献:https://blog.csdn.net/hyperorbit/article/details/88095384 (二)去下列网址下载离线包下载工具:https://ww2.math ...

  3. vue路由监听及路由守卫

    路由监听: //当一个组件被复用的时候,那么路由发生变化,但是页面上面的数据不会发生变化 新建one.vue 组件 作为home的子组件,在home.vue 中写遍历渲染页面 ,并用params传参, ...

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

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

  5. leetcode解题报告(29):Student Attendance Record I

    描述 You are given a string representing an attendance record for a student. The record only contains ...

  6. 【数论】P1029 最大公约数和最小公倍数问题

    题目链接 P1029 最大公约数和最小公倍数问题 思路 如果有两个数a和b,他们的gcd(a,b)和lcm(a,b)的乘积就等于ab. 也就是: ab=gcd(a,b)*lcm(a,b) 那么,接下来 ...

  7. 交互设计算法基础(3) - Quick Sort

    int pivotIndex, pivot, swapIndex; void swap(int[] arr, int x, int y) { int temp = arr[x]; arr[x] = a ...

  8. 零基础Python接口测试教程

    目录 一.Python基础 Python简介.环境搭建及包管理 Python基本语法 基本数据类型(6种) 条件/循环 文件读写(文本文件) 函数/类 模块/包 常见算法 二.接口测试快速实践 简单接 ...

  9. 常用spaceclaim脚本(二)

    #创建一个草图 #第一个参数传入一个Frame对象 #通过一个点和两个向量创建Frame #Frame的类成员函数Create被重载 #重载函数1:Frame.Create(Point, Direct ...

  10. qt creator中常用快捷键

    激活欢迎模式 Ctrl + 1 激活编辑模式 Ctrl + 2 激活调试模式 Ctrl + 3 激活项目模式 Ctrl + 4 激活帮助模式 Ctrl + 5 激活输出模式 Ctrl + 6 查找当前 ...