File tree 3 files changed +37
-0
lines changed
solution/1900-1999/1967.Number of Strings That Appear as Substrings in Word
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,20 @@ class Solution {
90
90
}
91
91
```
92
92
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
+
93
107
### ** C++**
94
108
95
109
``` cpp
Original file line number Diff line number Diff line change @@ -80,6 +80,20 @@ class Solution {
80
80
}
81
81
```
82
82
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
+
83
97
### ** C++**
84
98
85
99
``` cpp
Original file line number Diff line number Diff line change
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
+ } ;
You can’t perform that action at this time.
0 commit comments