当前位置:网站首页>2022.6.4-----leetcode. nine hundred and twenty-nine
2022.6.4-----leetcode. nine hundred and twenty-nine
2022-06-10 04:45:00 【Lu 727】
public int numUniqueEmails(String[] emails) {
Set<String> set=new HashSet<>();// duplicate removal
for(String email:emails){
StringBuilder sb=new StringBuilder();
// Handle @ Before the string
for(int i=0;email.charAt(i)!='@';i++){
if(email.charAt(i)=='.')
continue;
if(email.charAt(i)=='+')
break;
sb.append(email.charAt(i));
}
sb.append(email.substring(email.indexOf('@')));// Add domain name
set.add(sb.toString());
}
return set.size();
}边栏推荐
- 2022 refrigeration and air conditioning equipment operation special operation certificate examination question bank simulated examination platform operation
- [android l]seandrod security enhancement background summary and impact
- IDEA不小心排除常用类的自动导包或补全
- 2022 examination questions and online simulation examination for main principals of hazardous chemical business units
- MindSpore缺失与torch.nn.Maxpool3d和torch.nn.Avgpool3d对标的算子
- 2022年流动式起重机司机考试题及在线模拟考试
- Webcodecs解析GIF图
- Execution strategy of application software efficiency test
- 2022.5.27-----leetcode. Interview 17.11
- Email: analysis of wrong arrangement
猜你喜欢
随机推荐
Informatics Olympiad 1288: Triangle optimal path problem | openjudge noi 2.6 7625: triangle optimal path problem
IDEA不小心排除常用类的自动导包或补全
ThreadLocal not yet? Come and have a look!
Mindspire's nn Can pad specify dimension filling
Metersphere | a super easy-to-use open source testing platform
5 minutes to learn how to set up local pypi source
2022年广东省安全员A证第三批(主要负责人)考试题及在线模拟考试
25. Bom Event
The relationship between libc, glibc and glib
Mindscore1.6conda installation GPU version verification failed
Who ate IO?
使用MindSpore多数据集混合采样并加载
Question bank and answers of operation certificate examination for safety production management personnel of hazardous chemical production units in 2022
Distributed data object: HyperTerminal 'global variable'
Informatics Olympiad all in one 1287: minimum toll | openjudge noi 2.6 7614: minimum toll
Error of clip operator in mindconvert model transformation
Mysql database (25): foreing key
TCP (sliding window, flow control)
25. BOM events
Softing为艾默生提供AMS设备管理系统的连接解决方案





![[depth first search] toy snake: maze problem](/img/9c/1c74ea1f7c9367a9bec4e1663a853a.png)



