Java Easy Solution || Using Hashmap
\nclass Solution {\n    public int numMatchingSubseq(String s, String[] words) {\n        Map<Character, Queue<String>> mp = new HashMap<>();\n        int ans =
```\nclass Solution {\n    public int numMatchingSubseq(String s, String[] words) {\n        Map<Character, Queue<String>> mp = new HashMap<>();\n        int ans = 0;\n        \n        for(int i=0;i<s.length();++i)\n            mp.putIfAbsent(s.charAt(i), new LinkedList<>());\n        \n        for(String word : words) {\n            char startCh = word.charAt(0);\n            if(mp.containsKey(startCh))\n                mp.get(startCh).offer(word);\n        }\n        \n        for(int i=0;i<s.length();++i) {\n            char startCh = s.charAt(i);\n            Queue<String> que = mp.get(startCh);\n            int size = que.size();\n            for(int j=0;j<size;++j) {\n                String str = que.poll();\n                if(str.substring(1).length()==0)\n                    ans++;\n                else\n                    if(mp.containsKey(str.charAt(1)))\n                        mp.get(str.charAt(1)).add(str.substring(1));\n            }\n        }\n        \n        return ans;\n    }\n}\n```
['Java']