当前位置:网站首页>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);
}
}边栏推荐
- 他做国外LEAD,用了一年时间,把所有房贷都还清了
- 海思3559万能平台搭建:YUV422的踩坑记录
- abc 258 G - Triangle(bitset)
- lambda表达式
- Consolidated expression C case simple variable operation
- Hong Kong Jewelry tycoon, 2.2 billion "bargain hunting" Giordano
- 业务实现-日志写到同一个行数据里面
- Fast analysis -- easy to use intranet security software
- The input of uniapp is invalid except for numbers
- 如何用快解析自制IoT云平台
猜你喜欢
![[IELTS reading] Wang Xiwei reading P4 (matching1)](/img/91/1b3f85410035f65acb0c205185f698.png)
[IELTS reading] Wang Xiwei reading P4 (matching1)

How long does it take to obtain a PMP certificate?

《论文笔记》Multi-UAV Collaborative Monocular SLAM

雅思考试流程、需要具体注意些什么、怎么复习?

Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC

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

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

同事的接口文档我每次看着就头大,毛病多多。。。

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

「运维有小邓」域密码策略强化器
随机推荐
URLs and URIs
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Using fast parsing intranet penetration to realize zero cost self built website
挖财学院开户安全的吗?开户怎么开?
JS convert pseudo array to array
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
[Peking University] tensorflow2.0-1-opening
Date time type and format in MySQL
It's too convenient. You can complete the code release and approval by nailing it!
P4408 [NOI2003] 逃学的小孩(树的直径)
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
[kotlin] the third day
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
《论文笔记》Multi-UAV Collaborative Monocular SLAM
巩固表达式C# 案例简单变量运算
Paper notes multi UAV collaborative monolithic slam
城市轨道交通站应急照明疏散指示系统设计
业务实现-日志写到同一个行数据里面
Verilog tutorial (11) initial block in Verilog
P4408 [noi2003] truant children (tree diameter)