Skip to content

Commit b28eab9

Browse files
committed
Runtime: 107 ms (Top 57.83%) | Memory: 44.1 MB (Top 42.17%)
1 parent f57e157 commit b28eab9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/algorithms/E/Expressive Words/Expressive Words.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 107 ms (Top 57.83%) | Memory: 44.1 MB (Top 42.17%)
12
/**
23
* @param {string} s
34
* @param {string[]} words
@@ -21,7 +22,7 @@ var expressiveWords = function(s, words) {
2122
let i = 0;
2223
let flag = true;
2324
if(charArr.length > s.length)continue
24-
25+
2526
while( i < charArr.length ){
2627
let count = 1
2728
while(charArr[i] === charArr[i+1]){
@@ -34,12 +35,10 @@ var expressiveWords = function(s, words) {
3435
}
3536
idx++;
3637
i++
37-
38-
39-
38+
4039
}
4140
if(idx !== arr.length)flag = false
4241
if(flag)ans++
4342
}
4443
return ans
45-
};
44+
};

0 commit comments

Comments
 (0)