【Leetcode_easy】929. Unique Email Addresses
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;
完
【Leetcode_easy】929. Unique Email Addresses的更多相关文章
- 【leetcode】929. Unique Email Addresses
题目如下: Every email consists of a local name and a domain name, separated by the @ sign. For example, ...
- 【LeetCode】929. Unique Email Addresses 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 set + 字符串操作 参考资料 日期 题目地址:h ...
- 929. Unique Email Addresses
929. Unique Email Addresses Easy 22766FavoriteShare Every email consists of a local name and a domai ...
- [leetcode] 929. Unique Email Addresses (easy)
统计有几种邮箱地址. 邮箱名类型:local@domain 规则:1. local中出现"."的,忽略. a.bc=abc 2. local中出现"+"的,+以 ...
- [LeetCode] 929. Unique Email Addresses 唯一的电邮地址
Every email consists of a local name and a domain name, separated by the @ sign. For example, in ali ...
- [LeetCode] 929. Unique Email Addresses 独特的邮件地址
Every email consists of a local name and a domain name, separated by the @ sign. For example, in ali ...
- LeetCode 929.Unique Email Addresses
Description Every email consists of a local name and a domain name, separated by the @ sign. For exa ...
- LeetCode 929 Unique Email Addresses 解题报告
题目要求 Every email consists of a local name and a domain name, separated by the @ sign. For example, i ...
- LeetCode 929. Unique Email Addresses (独特的电子邮件地址)
题目标签:String 题目说明 有两个规则针对于 local name. 所以先把local name 和 domain name 分开. 两个规则是: rule 1:'.' 会被去除. (利用re ...
随机推荐
- 洛谷 P2296 寻找道路 题解
每日一题 day42 打卡 Analysis 首先,预处理,把每条边反向. 从终点开始bfs,标记从终点开始可以走到的点. 第二步,枚举每一个点,如果这个点没有被标记,则枚举它的每一条出边(反向后的) ...
- 自用ajax的json请求
function singlePriceSubmit(){ var json={}; json["area"]=areaStr1; json["goodCateIdStr ...
- P2502 [HAOI2006]旅行——暴力和并查集的完美结合
P2502 [HAOI2006]旅行 一定要看清题目数据范围再决定用什么算法,我只看着是一个蓝题就想到了记录最短路径+最小生成树,但是我被绕进去了: 看到只有5000的边,我们完全可以枚举最小边和最大 ...
- [MYSQL手工注入](3)基于报错的SQL注入实战
0x03 MYSQL 手工注入实战--基于错误的 SQL 注入 今天如愿以偿的找到了基于错误的SQL注入环境了:是一个国外卖音响的小网站,还在建设中: 看一下报错信息: (1)确定闭合语句:从上面的报 ...
- Spark(五十):使用JvisualVM监控Spark Executor JVM
引导 Windows环境下JvisulaVM一般存在于安装了JDK的目录${JAVA_HOME}/bin/JvisualVM.exe,它支持(本地和远程)jstatd和JMX两种方式连接远程JVM. ...
- Genome Aggregation Database (gnomAD) 简介 | 参考人群等位基因频率数据库
Genome Aggregation Database (gnomAD) 这是一个关于什么的数据库?broad institute开发的,整合了目前几乎所有的公共的WES和WGS测序数据,并对数据做了 ...
- DNA甲基化与癌症、泛癌早筛 | DNA methylation and pan-cancer
虽然我们现在完全没有甲基化的数据,但还是可以了解一下. 什么是DNA甲基化,与组蛋白修饰有什么联系? DNA Methylation and Its Basic Function 表观的定义就是DNA ...
- Java 自动装箱/拆箱
自动装箱/拆箱大大方便了基本类型(8个基本类型)数据和它们包装类的使用 自动装箱 : 基本类型自动转为包装类(int >> Integer) 自动拆箱: 包装类自动转为基本类型(Integ ...
- SKU是什么意思?
在做电商项目时候必定会遇到这个词,那是什么意思呢?其实简单来讲就是一个单位. SKU全称为Stock Keeping Unit(库存量单位),即库存进出计量的基本单元,可以是以件,盒,托盘等为单位.S ...
- phpstorm 使用xdebug断点
1.下载对应版本 xdebug 下载地址:https://download.csdn.net/download/q2104574/11185239 比如你用的php7.0.12以上的版本,xdebug ...