当前位置:网站首页>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;
}
边栏推荐
- C - linear table
- 35岁那年,我做了一个面临失业的决定
- Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function
- C language greedy snake
- Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
- C simple question one
- The file format and extension of XLS do not match
- Boost regex library source code compilation
- 10 schemes to ensure interface data security
- SAP memory parameter tuning process
猜你喜欢
SAP HR reward and punishment information export
一鍵免費翻譯300多頁的pdf文檔
The file format and extension of XLS do not match
UIC564-2 附录4 –阻燃防火测试:火焰的扩散
HB 5469民用飞机机舱内部非金属材料燃烧试验方法
0-1 knapsack problem
激光slam学习(2D/3D、偏实践)
ASP. Net core middleware request processing pipeline
BSS 7230 航空内饰材料阻燃性能测试
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
随机推荐
postgres timestamp转人眼时间字符串或者毫秒值
串联二极管,提高耐压
Magic fast power
ping报错:未知的名称或服务
SAP HR labor contract information 0016
一个测试工程师的7年感悟 ---- 致在一路独行的你(别放弃)
HDU - 1260 Tickets(线性DP)
Stringutils tool class
一键免费翻译300多页的pdf文档
Understand TCP's three handshakes and four waves with love
Anti climbing means cracking the second
95. (cesium chapter) cesium dynamic monomer-3d building (building)
How did a fake offer steal $540million from "axie infinity"?
网上买基金安全么?
数据库面试题+解析
P1308 [noip2011 popularity group] count the number of words
【7.4】25. Turn over the linked list in groups of K
Svn relocation
C cat and dog
Laser slam learning (2d/3d, partial practice)