1684 | JavaScript 1-Line Solution
Runtime: 116 ms, faster than 74.53% of JavaScript online\n> Memory Usage: 52.1 MB, less than 19.57% of JavaScript online\n\njavascript\n/**\n * @param {string} 
> Runtime: **116 ms**, faster than *74.53%* of JavaScript online\n> Memory Usage: **52.1 MB**, less than *19.57%* of JavaScript online\n\n```javascript\n/**\n * @param {string} allowed\n * @param {string[]} words\n * @return {number}\n */\nconst countConsistentStrings = (allowed, words) =>\n  (allowedSet =>\n    words.reduce(\n      (acc, curr) => acc + [...curr].every(char => allowedSet.has(char)),\n      0,\n    ))(new Set(allowed));\n```\n\nAnd here is the boring multiple line solution.\n\n> Runtime: **112 ms**, faster than *85.57%* of JavaScript online submissions\n> Memory Usage: **47.7 MB**, less than *81.96%* of JavaScript online submissions\n\n```javascript\n/**\n * @param {string} allowed\n * @param {string[]} words\n * @return {number}\n */\nconst countConsistentStrings = (allowed, words) => {\n  const allowedSet = new Set(allowed);\n  let cntConsistent = 0;\n  outer: for (const word of words) {\n    for (const char of word) if (!allowedSet.has(char)) continue outer;\n    cntConsistent++;\n  }\n  return cntConsistent;\n};\n```\n
['JavaScript']