Skip to content

Commit cdb5799

Browse files
committed
📝 upload 1967th README
1 parent 7c8ee5d commit cdb5799

File tree

1 file changed

+49
-0
lines changed
  • LeetCode/1967. Number of Strings That Appear as Substrings in Word

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# [1967. Number of Strings That Appear as Substrings in Word](https://leetcode.cn/problems/number-of-strings-that-appear-as-substrings-in-word/description/)
2+
3+
![](https://img.shields.io/badge/Difficulty-Easy-green.svg)
4+
5+
<details>
6+
<summary>Topics</summary>
7+
8+
* [`String`](https://leetcode.com/tag/string/)
9+
10+
</details>
11+
<br />
12+
13+
Given an array of strings `patterns` and a string `word`, return *the **number** of strings in `patterns` that exist as a **substring** in `word`*.
14+
15+
A **substring** is a contiguous sequence of characters within a string.
16+
17+
**Example 1:**
18+
19+
Input: patterns = ["a","abc","bc","d"], word = "abc"
20+
Output: 3
21+
Explanation:
22+
- "a" appears as a substring in "abc".
23+
- "abc" appears as a substring in "abc".
24+
- "bc" appears as a substring in "abc".
25+
- "d" does not appear as a substring in "abc".
26+
3 of the strings in patterns appear as a substring in word.
27+
28+
**Example 2:**
29+
30+
Input: patterns = ["a","b","c"], word = "aaaaabbbbb"
31+
Output: 2
32+
Explanation:
33+
- "a" appears as a substring in "aaaaabbbbb".
34+
- "b" appears as a substring in "aaaaabbbbb".
35+
- "c" does not appear as a substring in "aaaaabbbbb".
36+
2 of the strings in patterns appear as a substring in word.
37+
38+
**Example 3:**
39+
40+
Input: patterns = ["a","a","a"], word = "ab"
41+
Output: 3
42+
Explanation: Each of the patterns appears as a substring in word "ab".
43+
44+
**Constraints:**
45+
46+
+ `1 <= patterns.length <= 100`
47+
+ `1 <= patterns[i].length <= 100`
48+
+ `1 <= word.length <= 100`
49+
+ `patterns[i]` and `word` consist of lowercase English letters.

0 commit comments

Comments
 (0)