Javascript two pointers, 2 solutions
Solution 1\n\nvar numMatchingSubseq = function (S, words) {\n  let count = 0\n  const map = new Map()\n  \n  for(const w of words){\n    map.set(w, (map.get(w) 
**Solution 1**\n```\nvar numMatchingSubseq = function (S, words) {\n  let count = 0\n  const map = new Map()\n  \n  for(const w of words){\n    map.set(w, (map.get(w) || 0) + 1)\n  }\n  \n  for (let [w, val] of map) {\n    let i = 0, j = 0\n    while (j < w.length && i < S.length) {\n      if (w[j] == S[i]) {\n        j += 1\n        i += 1\n      }else {\n        i += 1\n      }\n    }\n    if (j == w.length) {\n      count += map.get(w)\n    }    \n  }\n  return count\n};\n```\n\n**Solution 2**\n```\nvar numMatchingSubseq = function(s, words) {\n  let count = 0\n  for(let w of words){\n    if(findSubsequence(s, w)) count++\n  }\n  return count\n};\n  \nfunction findSubsequence(s, w){\n  let idx = -1\n  for(const c of w){\n    const found = s.indexOf(c, idx+1)\n    if(found == -1) return false\n    idx = found\n  }\n  return true\n}\n```
['Two Pointers', 'JavaScript']