LeetCode --- 1961. Check If String Is a Prefix of Array 解题报告

Question:

Given a string s and an array of strings words, determine whether s is a prefix string of words.

A string s is a prefix string of words if s can be made by concatenating the first k strings in words for some positive k no larger than words.length.

Return true if s is a prefix string of words, or false otherwise.

Example 1:

Input: s = "iloveleetcode", words = ["i","love","leetcode","apples"]
Output: true
Explanation:
s can be made by concatenating "i", "love", and "leetcode" together.

你可能感兴趣的:(Python,算法,LeetCode,leetcode,算法,数据结构,Python,面试)