当前位置:网站首页>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;
}边栏推荐
- @Detailed introduction of configuration annotation
- Restricted linear table
- Class C design questions
- 保证接口数据安全的10种方案
- 快速回复二极管整流特性
- c—线性表
- About the difference between ch32 library function and STM32 library function
- B_ QuRT_ User_ Guide(38)
- 【7.4】25. Turn over the linked list in groups of K
- Chisel tutorial - 02 Chisel environment configuration and implementation and testing of the first chisel module
猜你喜欢

BSS 7230 flame retardant performance test of aviation interior materials

C inheritance and interface design polymorphism

Aitm3.0005 smoke toxicity test
![Balanced binary tree [AVL tree] - insert, delete](/img/1f/cd38b7c6f00f2b3e85d4560181a9d2.png)
Balanced binary tree [AVL tree] - insert, delete

Wechat applet development beginner 1

激光slam学习(2D/3D、偏实践)

DataGuard active / standby cleanup archive settings

一键免费翻译300多页的pdf文档

Flash encryption process and implementation of esp32

【LeetCode】20、有效的括号
随机推荐
HDU - 1260 Tickets(线性DP)
95. (cesium chapter) cesium dynamic monomer-3d building (building)
What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method
Ora-02437 failed to verify the primary key violation
go time包常用函数
Learn about scratch
【路径规划】使用垂距限值法与贝塞尔优化A星路径
Interface
codeforces每日5题(均1500)-第八天
一个测试工程师的7年感悟 ---- 致在一路独行的你(别放弃)
DataGuard active / standby cleanup archive settings
一份假Offer如何盗走了「Axie infinity」5.4亿美元?
C language greedy snake
May day C - most
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
B_ QuRT_ User_ Guide(38)
Wechat applet development beginner 1
Navicat connects Oracle
MySQL Architecture
Chisel tutorial - 00 Ex.scala metals plug-in (vs Code), SBT and coursier exchange endogenous