当前位置:网站首页>Leetcode1961. 检查字符串是否为数组前缀
Leetcode1961. 检查字符串是否为数组前缀
2022-07-06 01:10: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;
}
}
边栏推荐
- Obstacle detection
- The basic usage of JMeter BeanShell. The following syntax can only be used in BeanShell
- 关于#数据库#的问题:(5)查询库存表中每本书的条码、位置和借阅的读者编号
- Arduino hexapod robot
- China Taiwan strategy - Chapter 8: digital marketing assisted by China Taiwan
- Distributed base theory
- After 95, the CV engineer posted the payroll and made up this. It's really fragrant
- Intensive learning weekly, issue 52: depth cuprl, distspectrl & double deep q-network
- Vulhub vulnerability recurrence 74_ Wordpress
- Promise
猜你喜欢

VMware Tools installation error: unable to automatically install vsock driver

Fibonacci number

ADS-NPU芯片架构设计的五大挑战

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

Four commonly used techniques for anti aliasing

Differences between standard library functions and operators

Cf:c. the third problem

Opinions on softmax function

KDD 2022 | 脑电AI助力癫痫疾病诊断

Cannot resolve symbol error
随机推荐
Finding the nearest common ancestor of binary search tree by recursion
Who knows how to modify the data type accuracy of the columns in the database table of Damon
The detailed page returns to the list and retains the original position of the scroll bar
Synchronized and reentrantlock
详细页返回列表保留原来滚动条所在位置
Obstacle detection
MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning
Why can't mathematics give machine consciousness
2020.2.13
可恢复保险丝特性测试
esxi的安装和使用
基於DVWA的文件上傳漏洞測試
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
The population logic of the request to read product data on the sap Spartacus home page
The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
Blue Bridge Cup embedded stm32g431 - the real topic and code of the eighth provincial competition
Novice entry depth learning | 3-6: optimizer optimizers
Keepalive component cache does not take effect
面试必刷算法TOP101之回溯篇 TOP34
A preliminary study of geojson