当前位置:网站首页>2022.07.03(LC_6108_解密消息)
2022.07.03(LC_6108_解密消息)
2022-07-05 00:08:00 【Leeli9316】

方法:模拟
class Solution {
public String decodeMessage(String key, String message) {
Map<Character, Character> map = new HashMap<>();
char c = 'a';
for (char ch : key.replace(" ", "").toCharArray()) {
if (!map.containsKey(ch)) {
map.put(ch, c++);
}
}
char[] m = message.toCharArray();
for (int i = 0; i < m.length; i++) {
if (m[i] != ' ') {
m[i] = map.get(m[i]);
}
}
return new String(m);
}
}边栏推荐
- P3304 [sdoi2013] diameter (diameter of tree)
- [JS] - [sort related] - Notes
- Netcore3.1 JSON web token Middleware
- Remember to build wheels repeatedly at one time (the setting instructions of obsidian plug-in are translated into Chinese)
- Summary of week 22-07-02
- uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
- IT转测试岗,从迷茫到坚定我究竟付出了什么?
- 微服务(Microservice)那点事儿
- 取得PMP证书需要多长时间?
- Using the uniapp rich text editor
猜你喜欢

Acrel-EMS综合能效平台在校园建设的意义

45岁教授,她投出2个超级独角兽

ORB(Oriented FAST and Rotated BRIEF)

How to apply for PMP project management certification examination?

Microservice
![[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])](/img/83/63296108b47eda37c19b9ff9deb5ec.png)
[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])

How many triangles are there in the golden K-line diagram?

华为200万年薪聘请数据治理专家!背后的千亿市场值得关注

他做国外LEAD,用了一年时间,把所有房贷都还清了

人脸识别5- insight-face-paddle-代码实战笔记
随机推荐
Date time type and format in MySQL
快解析——好用的内网安全软件
业务场景功能的继续修改
Meet ThreadPoolExecutor
Financial markets, asset management and investment funds
如何有效对直流列头柜进行监测
快解析内网穿透帮助企业快速实现协同办公
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
Pytoch --- use pytoch to realize linknet for semantic segmentation
How to apply for PMP project management certification examination?
Tester's algorithm interview question - find mode
如何用快解析自制IoT云平台
挖财学院开户安全的吗?开户怎么开?
企业应用业务场景,功能添加和修改C#源码
[IELTS reading] Wang Xiwei reading P3 (heading)
Paddleocr tutorial
Face recognition 5- insight face padding code practice notes
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
Hash table, hash function, bloom filter, consistency hash
他做国外LEAD,用了一年时间,把所有房贷都还清了