Skip to content

Commit 42aedb1

Browse files
committed
Time: 12 ms (59.06%), Space: 58.3 MB (43.31%) - LeetHub
1 parent f756848 commit 42aedb1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @param {string[]} words
3+
* @param {character} separator
4+
* @return {string[]}
5+
*/
6+
var splitWordsBySeparator = function(words, separator) {
7+
let res = [];
8+
for (const word of words) {
9+
let list = word.split(separator).filter(e => e!="");
10+
list.forEach(e => res.push(e))
11+
}
12+
return res;
13+
};

0 commit comments

Comments
 (0)