当前位置:网站首页>Force buckle 1961 Check whether the string is an array prefix
Force buckle 1961 Check whether the string is an array prefix
2022-07-07 20:06:00 【Tomorrowave】
1961. Check whether the string is an array prefix
Give you a string s And an array of strings words , Please judge s Is it words Of Prefix string .
character string s To be words Of Prefix string , Need to meet :s Can be words In front of k(k by Positive numbers ) Strings are concatenated in order to get , And k No more than words.length .
If s yes words Of Prefix string , return true ; otherwise , return false .
Code section
class Solution:
def isPrefixString(self, s: str, words: List[str]) -> bool:
b=''
for i in range(len(words)):
b+=words[i]
if b==s:
return True
return False
边栏推荐
- How to cooperate among multiple threads
- Le PGR est - il utile au travail? Comment choisir une plate - forme fiable pour économiser le cœur et la main - d'œuvre lors de la préparation de l'examen!!!
- The DBSCAN function of FPC package of R language performs density clustering analysis on data, checks the clustering labels of all samples, and the table function calculates the two-dimensional contin
- 论文解读(ValidUtil)《Rethinking the Setting of Semi-supervised Learning on Graphs》
- Throughput
- CSDN syntax description
- JVM 类加载机制
- Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
- R language dplyr package mutate_ At function and min_ The rank function calculates the sorting sequence number value and ranking value of the specified data column in the dataframe, and assigns the ra
- LeetCode_7_5
猜你喜欢
Some important knowledge of MySQL
ASP.NET幼儿园连锁管理系统源码
位运算介绍
开源OA开发平台:合同管理使用手册
干货分享|DevExpress v22.1原版帮助文档下载集合
Data island is the first danger encountered by enterprises in their digital transformation
Simulate the implementation of string class
How to cooperate among multiple threads
让这个 CRMEB 单商户微信商城系统火起来,太好用了!
The project manager's "eight interview questions" is equal to a meeting
随机推荐
关于自身的一些安排
强化学习-学习笔记8 | Q-learning
力扣599. 两个列表的最小索引总和
Cuda版本不一致,编译apex报错
使用高斯Redis实现二级索引
力扣 643. 子数组最大平均数 I
831. KMP string
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the dot strip plot, set the position parameter, and configure the separation degree of different grouped
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
ASP.NET体育馆综合会员管理系统源码,免费分享
【剑指offer】剑指 Offer II 012. 左右两边子数组的和相等
【STL】vector
R language ggplot2 visualization: use the ggviolin function of ggpubr package to visualize the violin diagram, set the palette parameter to customize the filling color of violin diagrams at different
Some important knowledge of MySQL
干货分享|DevExpress v22.1原版帮助文档下载集合
8 CAS
R语言fpc包的dbscan函数对数据进行密度聚类分析、查看所有样本的聚类标签、table函数计算聚类簇标签与实际标签构成的二维列联表
Implement secondary index with Gaussian redis
整型int的拼接和拆分