当前位置:网站首页>Leetcode1961. Check whether the string is an array prefix
Leetcode1961. Check whether the string is an array prefix
2022-07-06 01:16:00 【May Hacker】
https://leetcode.cn/problems/check-if-string-is-a-prefix-of-array/
Java AC
class Solution {
public boolean isPrefixString(String s, String[] words) {
int index = 0;
for(int i=0;i<words.length;i++){
String str = words[i];
for(int j=0;j<str.length();j++){
if(index>=s.length() || str.charAt(j)!=s.charAt(index++)){
return false;
}
}
if(index==s.length()){
return true;
}
}
return false;
}
}
边栏推荐
- Promise
- Idea sets the default line break for global newly created files
- JMeter BeanShell的基本用法 一下语法只能在beanshell中使用
- logstash清除sincedb_path上传记录,重传日志数据
- BiShe - College Student Association Management System Based on SSM
- General operation method of spot Silver
- The basic usage of JMeter BeanShell. The following syntax can only be used in BeanShell
- Distributed base theory
- Pbootcms plug-in automatically collects fake original free plug-ins
- Daily practice - February 13, 2022
猜你喜欢

有谁知道 达梦数据库表的列的数据类型 精度怎么修改呀

Dede collection plug-in free collection release push plug-in

MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning

95后CV工程师晒出工资单,狠补了这个,真香...

yii中console方法调用,yii console定时任务
![[pat (basic level) practice] - [simple mathematics] 1062 simplest fraction](/img/b4/3d46a33fa780e5fb32bbfe5ab26a7f.jpg)
[pat (basic level) practice] - [simple mathematics] 1062 simplest fraction

ORA-00030

KDD 2022 | EEG AI helps diagnose epilepsy

How to extract MP3 audio from MP4 video files?

Convert binary search tree into cumulative tree (reverse middle order traversal)
随机推荐
1791. Find the central node of the star diagram / 1790 Can two strings be equal by performing string exchange only once
KDD 2022 | EEG AI helps diagnose epilepsy
Development trend of Ali Taobao fine sorting model
Leetcode 208. 实现 Trie (前缀树)
BiShe - College Student Association Management System Based on SSM
After Luke zettlemoyer, head of meta AI Seattle research | trillion parameters, will the large model continue to grow?
Getting started with devkit
JMeter BeanShell的基本用法 一下语法只能在beanshell中使用
Nmap: network detection tool and security / port scanner
Four dimensional matrix, flip (including mirror image), rotation, world coordinates and local coordinates
2020.2.13
Obstacle detection
Study diary: February 13, 2022
Tcpdump: monitor network traffic
golang mqtt/stomp/nats/amqp
How to see the K-line chart of gold price trend?
037 PHP login, registration, message, personal Center Design
SCM Chinese data distribution
Cf:h. maximum and [bit operation practice + K operations + maximum and]
Vulhub vulnerability recurrence 75_ XStream