当前位置:网站首页>2022.7.7-----leetcode.648
2022.7.7-----leetcode.648
2022-07-07 21:53:00 【路Lu727】
public String replaceWords(List<String> dictionary, String sentence) {
String[] ss=sentence.split(" ");
int n=ss.length;
for(int i=0;i<n;i++){
for(String dic:dictionary){
if(ss[i].startsWith(dic))
ss[i]=dic;
}
}
String ans="";
for(int i=0;i<n;i++){
ans+=ss[i];
if(i!=n-1)
ans+=" ";
}
return ans;
}边栏推荐
- [STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware
- MongoDB快速入门
- [stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code
- SAP HR family member information
- Flash encryption process and implementation of esp32
- Rock-paper-scissors
- C method question 2
- Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
- May day C - most
- gorm 关联关系小结
猜你喜欢

Anxin vb01 offline voice module access intelligent curtain guidance

c—线性表

ping报错:未知的名称或服务

Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function

95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)

The file format and extension of XLS do not match

What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method

SAP HR social work experience 0023

C number of words, plus ¥, longest word, average value

Summary of SQL single table query 2020.7.27
随机推荐
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
关于CH32库函数与STM32库函数的区别
二叉排序树【BST】——创建、查找、删除、输出
Map operation execution process
IDEA 2021.3. X cracking
How to login and enable synchronization function in Google browser
数据库面试题+解析
C method question 1
[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware
0-1 knapsack problem
[summary] some panels and videos seen
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
Dataguard 主备清理归档设置
Open source hardware small project: anxinco esp-c3f control ws2812
保证接口数据安全的10种方案
What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method
webflux - webclient Connect reset by peer Error
ASP. Net open web page
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
postgis学习