当前位置:网站首页>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;
}
边栏推荐
- MySQL架构
- Postgres timestamp to human eye time string or millisecond value
- 【路径规划】使用垂距限值法与贝塞尔优化A星路径
- An example analysis of MP4 file format parsing
- 快速回复二极管整流特性
- Get started with mongodb
- Restricted linear table
- 一键免费翻译300多页的pdf文档
- HB 5469 combustion test method for non-metallic materials in civil aircraft cabin
- Jisuan Ke - t3104
猜你喜欢
Take you hand in hand to build Eureka server with idea
Installing gradle
Chisel tutorial - 03 Combinatorial logic in chisel (chisel3 cheat sheet is attached at the end)
一鍵免費翻譯300多頁的pdf文檔
[experiment sharing] log in to Cisco devices through the console port
受限线性表
Progress broadcast | all 29 shield machines of Guangzhou Metro Line 7 have been launched
数据湖(十五):Spark与Iceberg整合写操作
MySQL架构
C - linear table
随机推荐
Dependency injection 2 advantage lifecycle
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
P1308 [noip2011 popularity group] count the number of words
C language greedy snake
2022.7.7-----leetcode.648
10 schemes to ensure interface data security
Oracle string sorting
MySQL架构
数据湖(十五):Spark与Iceberg整合写操作
Anti climbing means cracking the second
串联二极管,提高耐压
SAP HR labor contract information 0016
Possible SQL for Oracle table lookup information
一鍵免費翻譯300多頁的pdf文檔
C inheritance and interface design polymorphism
Take you hand in hand to build Eureka client with idea
平衡二叉树【AVL树】——插入、删除
postgis学习
The file format and extension of XLS do not match
Dependency injection