当前位置:网站首页>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);
}
}边栏推荐
- Selected cutting-edge technical articles of Bi Ren Academy of science and technology
- The input of uniapp is invalid except for numbers
- Financial markets, asset management and investment funds
- The pit of sizeof operator in C language
- 青海省国家湿地公园功能区划数数据、全国湿地沼泽分布数据、全国省市县自然保护区
- Some basic functions of enterprise projects are developed, and important things are saved to online first a
- 圖解網絡:什麼是網關負載均衡協議GLBP?
- Summer challenge brings you to play harmoniyos multi terminal piano performance
- Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
- Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
猜你喜欢

多回路仪表在基站“转改直”方面的应用

45岁教授,她投出2个超级独角兽

Using the uniapp rich text editor

The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!

Continuous modification of business scenario functions

企业公司项目开发好一部分基础功能,重要的事保存到线上第一a

Consolidated expression C case simple variable operation

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

XML的解析

Pytoch --- use pytoch to realize linknet for semantic segmentation
随机推荐
Combien de temps faut - il pour obtenir un certificat PMP?
How to save your code works quickly to better protect your labor achievements
Hong Kong Jewelry tycoon, 2.2 billion "bargain hunting" Giordano
Acrel-EMS综合能效平台在校园建设的意义
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
华为200万年薪聘请数据治理专家!背后的千亿市场值得关注
PaddleOCR教程
人脸识别5- insight-face-paddle-代码实战笔记
Upload avatar on uniapp
多回路仪表在基站“转改直”方面的应用
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
「运维有小邓」域密码策略强化器
Expand your kubecl function
How to do the project of computer remote company in foreign Internet?
如果炒股开华泰证券的户,在网上开户安全吗?
雅思考试流程、需要具体注意些什么、怎么复习?
AcWing164. 可达性统计(拓扑排序+bitset)
端口映射和端口转发区别是什么
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...