Simple java solution, used a map for last 7 test cases
Simple subsequence question and a map on top of that\n\n```\nclass Solution {\n    public static int numMatchingSubseq(String S, String[] words) {\n        int 
Simple subsequence question and a map on top of that\n\n```\nclass Solution {\n    public static int numMatchingSubseq(String S, String[] words) {\n        int result = 0;\n\n        HashMap<String, Boolean> map = new HashMap<String, Boolean>();\n        for (String word : words) {\n            if (!map.containsKey(word)) {\n                if (isSubSequence(word, S, word.length(), S.length()) || word.length() == 0) {\n                    result++;\n                    map.put(word, true);\n                } else {\n                    map.put(word, false);\n                }\n            } else {\n                if (map.get(word)) {\n                    result++;\n                }\n            }\n\n        }\n\n        return result;\n    }\n    \n    static boolean isSubSequence(String str1, String str2, int m, int n) {\n        int j = 0;\n\n        // Traverse str2 and str1, and compare\n        // current character of str2 with first\n        // unmatched char of str1, if matched\n        // then move ahead in str1\n        for (int i = 0; i < n && j < m; i++)\n            if (str1.charAt(j) == str2.charAt(i))\n                j++;\n\n        // If all characters of str1 were found\n        // in str2\n        return (j == m);\n    }\n}\n
['Java']