We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fccb7b commit 8a0c1fbCopy full SHA for 8a0c1fb
scripts/algorithms/W/Word Subsets/Word Subsets.js
@@ -1,3 +1,4 @@
1
+// Runtime: 409 ms (Top 44.03%) | Memory: 65.6 MB (Top 60.70%)
2
var wordSubsets = function(words1, words2) {
3
this.count = Array(26).fill(0);
4
let tmp = Array(26).fill(0);
@@ -14,8 +15,8 @@ var wordSubsets = function(words1, words2) {
14
15
};
16
17
function isSub(tmp){
- for(let i=0; i<26; i++)
18
- if(tmp[i] < this.count[i])
+ for(let i=0; i<26; i++)
19
+ if(tmp[i] < this.count[i])
20
return false;
21
return true;
22
@@ -25,4 +26,4 @@ function counter(s){
25
26
for(let c of s)
27
tmp[c.charCodeAt() - 97]++;
28
return tmp;
-};
29
+};
0 commit comments