当前位置:网站首页>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);
}
}边栏推荐
- Skills in analyzing the trend chart of London Silver
- OSEK standard ISO_ 17356 summary introduction
- 机器人强化学习——Learning Synergies between Pushing and Grasping with Self-supervised DRL (2018)
- [Peking University] tensorflow2.0-1-opening
- Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
- XML的解析
- Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
- 45岁教授,她投出2个超级独角兽
- If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
- 圖解網絡:什麼是網關負載均衡協議GLBP?
猜你喜欢

URL和URI

巩固表达式C# 案例简单变量运算

Summer challenge brings you to play harmoniyos multi terminal piano performance

微服务(Microservice)那点事儿

How to do the project of computer remote company in foreign Internet?

Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)

如何用快解析自制IoT云平台

如何避免电弧产生?—— AAFD故障电弧探测器为您解决

公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!

如何报考PMP项目管理认证考试?
随机推荐
城市轨道交通站应急照明疏散指示系统设计
积分商城游戏设置的基本要点
In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
Selected cutting-edge technical articles of Bi Ren Academy of science and technology
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
如何在外地外网电脑远程公司项目?
Remember to build wheels repeatedly at one time (the setting instructions of obsidian plug-in are translated into Chinese)
A new method for analyzing the trend chart of London Silver
「运维有小邓」域密码策略强化器
Hologres Query管理及超时处理
[paper reading] cavemix: a simple data augmentation method for brain vision segmentation
uniapp上传头像
He worked as a foreign lead and paid off all the housing loans in a year
JS how to realize array to tree
Cross domain request
Paddleocr tutorial
Using the uniapp rich text editor
跨域请求
How to apply for PMP project management certification examination?
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)