Counting Words With a Given Prefix LeetCode solution in JavaScript

1
var prefixCount = function (words, pref) {
2
return words.filter((word) => word.slice(0, pref.length) === pref).length;
3
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0