当前位置:网站首页>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)那点事儿
- Significance of acrel EMS integrated energy efficiency platform in campus construction
- Chinese verification of JS regular expressions (turn)
- js如何实现数组转树
- 如何有效对直流列头柜进行监测
- [path planning] RRT adds dynamic model for trajectory planning
- Verilog tutorial (11) initial block in Verilog
- In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
- Actual combat simulation │ JWT login authentication
- Paddleocr tutorial
猜你喜欢

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

城市轨道交通站应急照明疏散指示系统设计

Hong Kong Jewelry tycoon, 2.2 billion "bargain hunting" Giordano

IELTS examination process, what to pay attention to and how to review?

How to effectively monitor the DC column head cabinet

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

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

Fast parsing intranet penetration helps enterprises quickly achieve collaborative office

Face recognition 5- insight face padding code practice notes

Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
随机推荐
A new method for analyzing the trend chart of London Silver
Tester's algorithm interview question - find mode
Get to know ROS for the first time
GDB常用命令
城市轨道交通站应急照明疏散指示系统设计
快解析内网穿透帮助企业快速实现协同办公
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
Paper notes multi UAV collaborative monolithic slam
Date time type and format in MySQL
实战模拟│JWT 登录认证
URLs and URIs
How to effectively monitor the DC column head cabinet
AcWing164. 可达性统计(拓扑排序+bitset)
(script) one click deployment of any version of redis - the way to build a dream
Actual combat simulation │ JWT login authentication
[kotlin] the third day
Acwing164. Accessibility Statistics (topological sorting +bitset)
ORB(Oriented FAST and Rotated BRIEF)
PMP certificate renewal process