Java Solution, Using HashMap and two pointer method with some comments
My code run time is not quick enough,  only more fast than about 70%. However, it is intuitive.\nIs there any method that can make it quicker?\n\nclass Solution
My code run time is not quick enough,  only more fast than about 70%. However, it is intuitive.\nIs there any method that can make it quicker?\n```\nclass Solution {\n    public int numMatchingSubseq(String S, String[] words) {\n        int result = 0;\n        Map<String, Boolean> memo = new HashMap<>();\n        boolean checkTF = false;\n        // go through all elements of string array\n        for(String tmp: words) {\n            // if HashMap already store the specific string\n            if(memo.containsKey(tmp) == true) {\n                // if that string is True, then ans++, otherwise go to next loop.\n                if( memo.get(tmp) == true) {\n                    result++;\n                }\n                continue;\n            }\n            checkTF = check(S, tmp);\n            // if element length is longer than original string, it must be false\n            if(S.length() >= tmp.length() && checkTF == true) {\n                result++;\n            }\n            // add new string pattern in the HashMap\n            memo.put(tmp, checkTF);\n        }\n        return result;\n    }\n    // two pointer method to check whether the target string is subsequence of original string.\n    public boolean check(String S, String target) {\n        int cnt_1 = 0;\n        int cnt_2 = 0;\n        while(cnt_1 != S.length() && cnt_2 != target.length()) {\n            if(target.charAt(cnt_2) == S.charAt(cnt_1)) {\n                cnt_1++;\n                cnt_2++;\n            }\n            else {\n                cnt_1++;\n            }\n        }\n        if(cnt_2 == target.length()) {\n            return true;\n        }\n        return false;\n    }\n}\n```
['Two Pointers', 'Java']