当前位置:网站首页>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);
}
}边栏推荐
- Fast analysis -- easy to use intranet security software
- 公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
- [path planning] RRT adds dynamic model for trajectory planning
- XML的解析
- abc 258 G - Triangle(bitset)
- Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
- "Xiaodeng" domain password policy enhancer in operation and maintenance
- [IELTS reading] Wang Xiwei reading P3 (heading)
- Acrel-EMS综合能效平台在校园建设的意义
- How long does it take to obtain a PMP certificate?
猜你喜欢

Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet

ORB(Oriented FAST and Rotated BRIEF)

Build your own minecraft server with fast parsing

lambda表达式

Application of multi loop instrument in base station "switching to direct"
![[IELTS reading] Wang Xiwei reading P3 (heading)](/img/19/40564f2afc18fe3e34f218b7b44681.png)
[IELTS reading] Wang Xiwei reading P3 (heading)
![[path planning] RRT adds dynamic model for trajectory planning](/img/98/dd9b106fd9dc64e676d9c943c03ab3.jpg)
[path planning] RRT adds dynamic model for trajectory planning

IT转测试岗,从迷茫到坚定我究竟付出了什么?

用快解析内网穿透实现零成本自建网站

如何在外地外网电脑远程公司项目?
随机推荐
【雅思阅读】王希伟阅读P4(matching2段落信息配对题【困难】)
Some basic functions of enterprise projects are developed, and important things are saved to online first a
Summary of week 22-07-02
如何避免电弧产生?—— AAFD故障电弧探测器为您解决
URLs and URIs
【北京大学】Tensorflow2.0-1-开篇
圖解網絡:什麼是網關負載均衡協議GLBP?
企业应用业务场景,功能添加和修改C#源码
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
XML的解析
如何在外地外网电脑远程公司项目?
Go step on the pit - no required module provides package: go mod file not found in current directory or any parent
「运维有小邓」域密码策略强化器
Enterprise application business scenarios, function addition and modification of C source code
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
How long does it take to obtain a PMP certificate?
机器人强化学习——Learning Synergies between Pushing and Grasping with Self-supervised DRL (2018)
AcWing164. 可达性统计(拓扑排序+bitset)
巩固表达式C# 案例简单变量运算