当前位置:网站首页>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;
}
边栏推荐
- Come on, brother
- Flash encryption process and implementation of esp32
- SAP HR social work experience 0023
- P2141 [noip2014 popularization group] abacus mental arithmetic test
- Pycharm basic settings latest version 2022
- Chisel tutorial - 04 Control flow in chisel
- Anxin vb01 offline voice module access intelligent curtain guidance
- Laser slam learning (2d/3d, partial practice)
- Extract the file name under the folder under win
- Archery installation test
猜你喜欢
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
C cat and dog
一鍵免費翻譯300多頁的pdf文檔
Installing gradle
平衡二叉树【AVL树】——插入、删除
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
Pycharm basic settings latest version 2022
机器人(自动化)等专业课程创新的结果
SAP HR family member information
MP4文件格式解析之结合实例分析
随机推荐
关于CH32库函数与STM32库函数的区别
P2141 [noip2014 popularization group] abacus mental arithmetic test
HDU - 1260 Tickets(线性DP)
mysql8.0 ubuntu20.4
May day d-light
postgres timestamp转人眼时间字符串或者毫秒值
一键免费翻译300多页的pdf文档
【汇总】看过的一些Panel与视频
【路径规划】使用垂距限值法与贝塞尔优化A星路径
Display the server hard disk image to the browser through Servlet
SQL 使用in关键字查询多个字段
网上买基金安全么?
Pycharm basic settings latest version 2022
Rock-paper-scissors
Dependency injection
c—线性表
Codeworks 5 questions per day (average 1500) - day 8
通达信买基金安全吗?
Where are you going
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud