当前位置:网站首页>2022.07.03 (LC 6108 decryption message)
2022.07.03 (LC 6108 decryption message)
2022-07-05 00:14:00 【Leeli9316】

Method : simulation
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);
}
}边栏推荐
- The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!
- Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
- In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
- PMP certificate renewal process
- Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
- P4281 [ahoi2008] emergency assembly / gathering (LCA)
- 用快解析内网穿透实现零成本自建网站
- 挖财学院开户安全的吗?开户怎么开?
- Application of fire fighting system based on 3D GIS platform
- 「运维有小邓」域密码策略强化器
猜你喜欢
![[kotlin] the third day](/img/c4/1bf1b00c4a1dda920ad3bb178ac0f9.png)
[kotlin] the third day

Illustrated network: what is gateway load balancing protocol GLBP?

Fast analysis -- easy to use intranet security software

Hash table, hash function, bloom filter, consistency hash

他做国外LEAD,用了一年时间,把所有房贷都还清了
![[path planning] RRT adds dynamic model for trajectory planning](/img/98/dd9b106fd9dc64e676d9c943c03ab3.jpg)
[path planning] RRT adds dynamic model for trajectory planning

图解网络:什么是网关负载均衡协议GLBP?

Some basic functions of enterprise projects are developed, and important things are saved to online first a

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

「运维有小邓」域密码策略强化器
随机推荐
Tester's algorithm interview question - find mode
Detailed explanation of openharmony resource management
22-07-02周总结
[Peking University] tensorflow2.0-1-opening
如果炒股开华泰证券的户,在网上开户安全吗?
用快解析内网穿透实现零成本自建网站
Using fast parsing intranet penetration to realize zero cost self built website
Five papers recommended for the new development of convolutional neural network in deep learning
跨域请求
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
Business implementation - the log is written to the same row of data
打新债开户注册安全吗?有没有风险的?靠谱吗?
Using the uniapp rich text editor
【雅思阅读】王希伟阅读P4(matching1)
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
GDB common commands
JS 将伪数组转换成数组
It's too convenient. You can complete the code release and approval by nailing it!
如何用快解析自制IoT云平台
Summary of week 22-07-02