当前位置:网站首页>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);
}
}边栏推荐
- 业务场景功能的继续修改
- Actual combat simulation │ JWT login authentication
- 用快解析内网穿透实现零成本自建网站
- Continuous modification of business scenario functions
- Hong Kong Jewelry tycoon, 2.2 billion "bargain hunting" Giordano
- 【监控】zabbix
- URL和URI
- [path planning] RRT adds dynamic model for trajectory planning
- 快解析——好用的内网安全软件
- Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
猜你喜欢

js如何实现数组转树

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

PMP certificate renewal process

「运维有小邓」域密码策略强化器

Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?

He worked as a foreign lead and paid off all the housing loans in a year
![[paper reading] Tun det: a novel network for meridian ultra sound nodule detection](/img/25/e2366cabf00e55664d16455a6049e0.png)
[paper reading] Tun det: a novel network for meridian ultra sound nodule detection

如何有效对直流列头柜进行监测

lambda expressions

uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
随机推荐
Upload avatar on uniapp
Five papers recommended for the new development of convolutional neural network in deep learning
Get to know ROS for the first time
Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
P4281 [ahoi2008] emergency assembly / gathering (LCA)
In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
Enterprise application business scenarios, function addition and modification of C source code
Summer challenge brings you to play harmoniyos multi terminal piano performance
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
Introduction to ACM combination counting
Verilog tutorial (11) initial block in Verilog
初识ROS
P4408 [noi2003] truant children (tree diameter)
[error reporting] "typeerror: cannot read properties of undefined (reading 'split')“
PermissionError: [Errno 13] Permission denied: ‘data. csv‘
Go step on the pit - no required module provides package: go mod file not found in current directory or any parent
js如何实现数组转树
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
AcWing164. 可达性统计(拓扑排序+bitset)
Acrel-EMS综合能效平台在校园建设的意义