当前位置:网站首页>2022.4.10-----leetcode.804
2022.4.10-----leetcode.804
2022-04-23 01:44:00 【路Lu727】
public int uniqueMorseRepresentations(String[] words) {
Set<String> set=new HashSet<>();
String[] ss={".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."};
for(String word:words){
String s="";
for(int j=0;j<word.length();j++){
int idx=word.charAt(j)-'a';
s=s+ss[idx];
}
set.add(s);
}
return set.size();
}
版权声明
本文为[路Lu727]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_60466670/article/details/124355779
边栏推荐
- Solve the problem when installing MySQL
- When should I write unit tests? What is TDD?
- Longest common subsequence (record path version)
- [registration] tf54: engineer growth map and excellent R & D organization building
- 计蒜客:等边三角形(DFS)
- Technology cloud report: cloud computing has entered the "second half". Where is the way out for domestic cloud?
- 角色個人屬性英文縮寫
- Custom numeric input control
- Learning methods and career development guide (2022 Edition)
- Jerry's CPU performance test [chapter]
猜你喜欢

(product resources) mingdeyang ad8488 module high performance digital X-ray FMC interface 128 analog channel high-speed ADC chip

四级城市地区表 xlsx, sql文件,国内,中国省市县街道乡镇四级地址 (名称,联动ID,层级,是否末级(1-是))

The most easy to understand service container and scope of dependency injection

2022 low voltage electrician examination questions and answers

Detonate the bomb (DFS)

Do447 manage user and team access

Redis实现分布式锁

电子采购如何成为供应链中的增值功能?

Introduction to PCIe xdma IP core (with list) - mingdeyang science and Education (mdy edu. Com)

王子救公主(DFS)
随机推荐
.NET单元测试第一篇:常见.NET单元测试框架有哪些?
Encrypted compressed backup bat script
d盘分给C盘后,数据库恢复挂起怎么办,求各位解答
42. Use k3det in mmrotate for rotating target detection, MNN deployment and ncnn deployment
mb_ substr()、mb_ Strpos() function (story)
Modify array (and search set)
Realize the function of progress bar through layerdrawable
[registration] tf54: engineer growth map and excellent R & D organization building
NPM -- configure Taobao image
Vscode + PHP debug + namespace guidelines
Redis implements distributed locks
. net (c) MySQL conn.open() reports an error: solution to SSL connection error
力扣(LeetCode)112. 路径总和(2022.04.22)
NR polar code 七- SCL(succesive cancellation list decoding)
Jerry's CPU performance test [chapter]
Challenges often faced by client project management
English abbreviation of role personal attribute
计蒜客:数独(DFS)
王子救公主(DFS)
Dimension C China helping farmers in rural areas warms people's hearts the third stop is jiabaoguo farm