Skip to content

Commit e6be769

Browse files
committed
Runtime: 557 ms (Top 57.30%) | Memory: 24.5 MB (Top 81.25%)
1 parent 5098f0b commit e6be769

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/algorithms/S/Substring with Concatenation of All Words/Substring with Concatenation of All Words.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Runtime: 557 ms (Top 57.30%) | Memory: 24.5 MB (Top 81.25%)
2+
13
class Solution {
24
public:
35
vector<int> findSubstring(string s, vector<string>& words) {
@@ -9,7 +11,7 @@ class Solution {
911
string t;
1012
unordered_map<string, int> mp;
1113
for(auto i = 0; i < words.size(); ++i) ++mp[words[i]];
12-
14+
1315
for(int i = 0; i<= len; ++i){
1416
t = s.substr(i, n);
1517
if(mp.find(t) != mp.end()){
@@ -27,7 +29,7 @@ class Solution {
2729
if(flag && smp == mp) ans.push_back(i);
2830
}
2931
}
30-
32+
3133
return ans;
3234
}
33-
};
35+
};

0 commit comments

Comments
 (0)