当前位置:网站首页>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);
}
}边栏推荐
- Microservice
- 45 year old professor, she threw two super unicorns
- How many triangles are there in the golden K-line diagram?
- Acrel-EMS综合能效平台在校园建设的意义
- ORB(Oriented FAST and Rotated BRIEF)
- Continuous modification of business scenario functions
- The pit of sizeof operator in C language
- Meet ThreadPoolExecutor
- go踩坑——no required module provides package : go.mod file not found in current directory or any parent
- The input of uniapp is invalid except for numbers
猜你喜欢

【雅思阅读】王希伟阅读P4(matching1)

Application of fire fighting system based on 3D GIS platform

基于三维gis平台的消防系统运用

2022.07.03(LC_6108_解密消息)
![[path planning] RRT adds dynamic model for trajectory planning](/img/98/dd9b106fd9dc64e676d9c943c03ab3.jpg)
[path planning] RRT adds dynamic model for trajectory planning

如何用快解析自制IoT云平台
Date time type and format in MySQL

How to use fast parsing to make IOT cloud platform

abc 258 G - Triangle(bitset)

2022.07.03(LC_6111_统计放置房子的方式数)
随机推荐
lambda expressions
GDB common commands
如何有效对直流列头柜进行监测
What is the difference between port mapping and port forwarding
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
(script) one click deployment of any version of redis - the way to build a dream
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
【路径规划】RRT增加动力模型进行轨迹规划
TS快速入门-函数
Go step on the pit - no required module provides package: go mod file not found in current directory or any parent
【selenium自动化】常用注解
【北京大学】Tensorflow2.0-1-开篇
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
Netcore3.1 JSON web token Middleware
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
In the enterprise, win10 turns on BitLocker to lock the disk, how to back up the system, how to recover when the system has problems, and how to recover quickly while taking into account system securi
Instructions for go defer
基本放大电路的学习
AcWing164. 可达性统计(拓扑排序+bitset)
业务场景功能的继续修改