Python 3 || 8 lines, cached function || T/S: 96% / 96%
Here\'s the plan:\n\n1. We use the function checkWord to iterate through the words and, for each word w, wemove letter-by-letter though the string sto determine
Here\'s the plan:\n\n1. We use the function `checkWord` to iterate through the `words` and, for each word `w`, wemove letter-by-letter though the string `s`to determine whether `w` is a subsequence of `s`. If so, the function`checkWord` returns `True`.\n                     \n1. We map the function `checkWord` to the array `words` and return the count of `True` in that map.\n```\nclass Solution:\n    def numMatchingSubseq(self, s: str, words: list[str]) -> int:\n        \n        @lru_cache(1000)\n        def checkWord(word):\n\n            start = 0\n\n            for ch in word:\n                start = s.find(ch, start) + 1\n                if not start: return False\n                \n            return True\n        \n        return sum(map(checkWord,words))\n```\n[https://leetcode.com/problems/number-of-matching-subsequences/submissions/1204721041/?submissionId=1204719805](https://leetcode.com/problems/number-of-matching-subsequences/submissions/1204721041/?submissionId=1204719805)\n\n\n\nI could be wrong, but I think that time complexity is *O*(*MN*) and space complexity is *O*(*N*), in which *M* ~ `len(s)` and *N* ~ count of all characters in `words`.
['Python', 'Python3']