/**
* @param {string} allowed
* @param {string[]} words
* @return {number}
*/
var countConsistentStrings = function (allowed, words) {
allowed = new Set(allowed);
return words.reduce((count, word) => {
count += +[...word].every(w => allowed.has(w));
return count;
}, 0);
};