当前位置:网站首页>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;
}边栏推荐
- @Configuration注解的详细介绍
- Flash encryption process and implementation of esp32
- Oracle string sorting
- 2022.7.7-----leetcode.648
- 【7.4】25. Turn over the linked list in groups of K
- How did a fake offer steal $540million from "axie infinity"?
- Learn about scratch
- Take you hand in hand to build feign with idea
- SAP HR social work experience 0023
- postgres timestamp转人眼时间字符串或者毫秒值
猜你喜欢

Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)

一个测试工程师的7年感悟 ---- 致在一路独行的你(别放弃)

快速回复二极管整流特性

SAP HR reward and punishment information export

UIC564-2 附录4 –阻燃防火测试:火焰的扩散

Live server usage
![Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer](/img/1f/cd38b7c6f00f2b3e85d4560181a9d2.png)
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer

BSS 7230 航空内饰材料阻燃性能测试

C inheritance and interface design polymorphism

Flash encryption process and implementation of esp32
随机推荐
UIC564-2 附录4 –阻燃防火测试:火焰的扩散
网上买基金安全么?
Archery installation test
平衡二叉樹【AVL樹】——插入、删除
The for loop realizes 1-100 addition and eliminates the 4-digit tail number
Oracle string sorting
【7.4】25. Turn over the linked list in groups of K
webflux - webclient Connect reset by peer Error
C语言学习
codeforces每日5题(均1500)-第八天
SAP HR family member information
Stringutils tool class
Chisel tutorial - 02 Chisel environment configuration and implementation and testing of the first chisel module
一鍵免費翻譯300多頁的pdf文檔
Access database query all tables SQL
Take you hand in hand to build feign with idea
C language learning
HDU - 1260 tickets (linear DP)
保证接口数据安全的10种方案
AWS AWS help error