Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6e7fa57

Browse files
feat: add typescript solution to lc problem: No.1967.Number of Strings That Appear as Substrings in Word
1 parent ba4e2cb commit 6e7fa57

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

‎solution/1900-1999/1967.Number of Strings That Appear as Substrings in Word/README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ class Solution {
9090
}
9191
```
9292

93+
### **TypeScript**
94+
95+
```ts
96+
function numOfStrings(patterns: string[], word: string): number {
97+
let ans = 0;
98+
for (let pattern of patterns) {
99+
if (word.includes(pattern)) {
100+
ans++;
101+
}
102+
}
103+
return ans;
104+
};
105+
```
106+
93107
### **C++**
94108

95109
```cpp

‎solution/1900-1999/1967.Number of Strings That Appear as Substrings in Word/README_EN.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ class Solution {
8080
}
8181
```
8282

83+
### **TypeScript**
84+
85+
```ts
86+
function numOfStrings(patterns: string[], word: string): number {
87+
let ans = 0;
88+
for (let pattern of patterns) {
89+
if (word.includes(pattern)) {
90+
ans++;
91+
}
92+
}
93+
return ans;
94+
};
95+
```
96+
8397
### **C++**
8498

8599
```cpp
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function numOfStrings(patterns: string[], word: string): number {
2+
let ans = 0;
3+
for (let pattern of patterns) {
4+
if (word.includes(pattern)) {
5+
ans++;
6+
}
7+
}
8+
return ans;
9+
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /