当前位置:网站首页>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);
}
}
边栏推荐
- If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
- [Peking University] tensorflow2.0-1-opening
- [IELTS reading] Wang Xiwei reading P4 (matching1)
- Data on the number of functional divisions of national wetland parks in Qinghai Province, data on the distribution of wetlands and marshes across the country, and natural reserves in provinces, cities
- Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
- Combien de temps faut - il pour obtenir un certificat PMP?
- 【雅思阅读】王希伟阅读P3(Heading)
- Nine Qi single chip microcomputer ny8b062d single key control four LED States
- Selected cutting-edge technical articles of Bi Ren Academy of science and technology
- The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!
猜你喜欢
如何避免电弧产生?—— AAFD故障电弧探测器为您解决
[IELTS reading] Wang Xiwei reading P3 (heading)
A new method for analyzing the trend chart of London Silver
[kotlin] the third day
How to do the project of computer remote company in foreign Internet?
[path planning] RRT adds dynamic model for trajectory planning
【雅思阅读】王希伟阅读P4(matching1)
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
如何用快解析自制IoT云平台
随机推荐
abc 258 G - Triangle(bitset)
Expand your kubecl function
22-07-02周总结
Actual combat simulation │ JWT login authentication
How many triangles are there in the golden K-line diagram?
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])
Data on the number of functional divisions of national wetland parks in Qinghai Province, data on the distribution of wetlands and marshes across the country, and natural reserves in provinces, cities
Some basic functions of enterprise projects are developed, and important things are saved to online first a
同事的接口文档我每次看着就头大,毛病多多。。。
French scholars: the explicability of counter attack under optimal transmission theory
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
【监控】zabbix
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
[IELTS reading] Wang Xiwei reading P3 (heading)
JS 将伪数组转换成数组
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
挖财学院开户安全的吗?开户怎么开?
Date time type and format in MySQL
IT转测试岗,从迷茫到坚定我究竟付出了什么?