当前位置:网站首页>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;
}
}
边栏推荐
- Gartner released the prediction of eight major network security trends from 2022 to 2023. Zero trust is the starting point and regulations cover a wider range
- 基于DVWA的文件上传漏洞测试
- golang mqtt/stomp/nats/amqp
- RAID disk redundancy queue
- Curlpost PHP
- Dedecms plug-in free SEO plug-in summary
- Paging of a scratch (page turning processing)
- 几百行代码实现一个 JSON 解析器
- 关于softmax函数的见解
- Hcip---ipv6 experiment
猜你喜欢

Finding the nearest common ancestor of binary search tree by recursion

测试/开发程序员的成长路线,全局思考问题的问题......

Exciting, 2022 open atom global open source summit registration is hot

Intensive learning weekly, issue 52: depth cuprl, distspectrl & double deep q-network

《强化学习周刊》第52期:Depth-CUPRL、DistSPECTRL & Double Deep Q-Network

看抖音直播Beyond演唱会有感

Some features of ECMAScript

cf:D. Insert a Progression【关于数组中的插入 + 绝对值的性质 + 贪心一头一尾最值】

cf:C. The Third Problem【关于排列这件事】

BiShe - College Student Association Management System Based on SSM
随机推荐
View class diagram in idea
Promise
测试/开发程序员的成长路线,全局思考问题的问题......
VMware Tools installation error: unable to automatically install vsock driver
Redis' cache penetration, cache breakdown, cache avalanche
Promise
[groovy] compile time meta programming (compile time method interception | method interception in myasttransformation visit method)
Overview of Zhuhai purification laboratory construction details
Distributed base theory
Recursive method converts ordered array into binary search tree
Test de vulnérabilité de téléchargement de fichiers basé sur dvwa
Starting from 1.5, build a micro Service Framework - call chain tracking traceid
Introduction to robotics I. spatial transformation (1) posture, transformation
【第30天】给定一个整数 n ,求它的因数之和
Cannot resolve symbol error
图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
Cf:h. maximum and [bit operation practice + K operations + maximum and]
Three methods of script about login and cookies
Blue Bridge Cup embedded stm32g431 - the real topic and code of the eighth provincial competition
记一个 @nestjs/typeorm^8.1.4 版本不能获取.env选项问题