当前位置:网站首页>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;
}
}
边栏推荐
- Recommended areas - ways to explore users' future interests
- CocoaPods could not find compatible versions for pod 'Firebase/CoreOnly'
- 2020.2.13
- MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练
- MySQL learning notes 2
- View class diagram in idea
- Condition and AQS principle
- In the era of industrial Internet, we will achieve enough development by relying on large industrial categories
- Questions about database: (5) query the barcode, location and reader number of each book in the inventory table
- FFT 学习笔记(自认为详细)
猜你喜欢
What is the most suitable book for programmers to engage in open source?
Hcip---ipv6 experiment
3D模型格式汇总
File upload vulnerability test based on DVWA
ORA-00030
The growth path of test / development programmers, the problem of thinking about the overall situation
Mlsys 2020 | fedprox: Federation optimization of heterogeneous networks
Pbootcms plug-in automatically collects fake original free plug-ins
Finding the nearest common ancestor of binary tree by recursion
Mathematical modeling learning from scratch (2): Tools
随机推荐
What is the most suitable book for programmers to engage in open source?
Cf:h. maximum and [bit operation practice + K operations + maximum and]
Study diary: February 13, 2022
Recommended areas - ways to explore users' future interests
Xunrui CMS plug-in automatically collects fake original free plug-ins
Leetcode study - day 35
测试/开发程序员的成长路线,全局思考问题的问题......
Leetcode sword finger offer 59 - ii Maximum value of queue
Ubantu check cudnn and CUDA versions
Building core knowledge points
037 PHP login, registration, message, personal Center Design
毕设-基于SSM高校学生社团管理系统
BiShe - College Student Association Management System Based on SSM
Recoverable fuse characteristic test
Nmap: network detection tool and security / port scanner
China Taiwan strategy - Chapter 8: digital marketing assisted by China Taiwan
VMware Tools installation error: unable to automatically install vsock driver
SSH login is stuck and disconnected
About error 2003 (HY000): can't connect to MySQL server on 'localhost' (10061)
cf:C. The Third Problem【关于排列这件事】