当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
B_ QuRT_ User_ Guide(38)
Ora-01741 and ora-01704
B_ QuRT_ User_ Guide(36)
MySQL架构
SAP HR 家庭成员信息
Summary of SQL single table query 2020.7.27
SAP HR labor contract information 0016
ESP at installation esp8266 and esp32 versions
Right click the idea file to create new. There is no solution to create new servlet
2022 certified surveyors are still at a loss when preparing for the exam? Teach you how to take the exam hand in hand?
随机推荐
May day d-light
平衡二叉樹【AVL樹】——插入、删除
Extended tree (I) - graphic analysis and C language implementation
[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware
SAP memory parameter tuning process
Reverse output three digit and arithmetic sequence
Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process
P1308 [noip2011 popularity group] count the number of words
Anxinco EC series modules are connected to the multi protocol access products of onenet Internet of things open platform
P2141 [noip2014 popularization group] abacus mental arithmetic test
Idea automatically generates serialVersionUID
IDEA 2021.3. X cracking
SLAM面试总结
One of the anti climbing methods
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
B_ QuRT_ User_ Guide(38)
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
How to login and enable synchronization function in Google browser
The file format and extension of XLS do not match
Given an array, such as [7864, 284, 347, 7732, 8498], now you need to splice the numbers in the array to return the "largest possible number."