当前位置:网站首页>2022.7.7-----leetcode. six hundred and forty-eight
2022.7.7-----leetcode. six hundred and forty-eight
2022-07-07 23:47:00 【Lu 727】
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;
}
边栏推荐
- The file format and extension of XLS do not match
- C # exchange number, judge to pass the exam
- Stringutils tool class
- webflux - webclient Connect reset by peer Error
- MongoDB快速入门
- Anti climbing means cracking the second
- 机器人(自动化)等专业课程创新的结果
- How did a fake offer steal $540million from "axie infinity"?
- 受限线性表
- 0-1 knapsack problem
猜你喜欢
Aitm3.0005 smoke toxicity test
机器人(自动化)等专业课程创新的结果
激光slam学习(2D/3D、偏实践)
串联二极管,提高耐压
Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware
AITM3.0005 烟雾毒性测试
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
FFA与ICGA造影
An example analysis of MP4 file format parsing
随机推荐
C cat and dog
激光slam学习(2D/3D、偏实践)
Aitm3.0005 smoke toxicity test
AWS AWS help error
Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
webflux - webclient Connect reset by peer Error
Jisuan Ke - t3104
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
Installing gradle
JNI uses asan to check memory leaks
95. (cesium chapter) cesium dynamic monomer-3d building (building)
C语言学习
C language learning
Dataguard 主备清理归档设置
保证接口数据安全的10种方案
postgis学习
Oracle statistics by time
An example analysis of MP4 file format parsing
[experiment sharing] log in to Cisco devices through the console port
2022.7.7-----leetcode.648