Easy to Understand Java Solution, Explanation with Comments with String functions
\nclass Solution {\n    \n    \n    /* Approach: For every word, check if it is subsequence of input string */\n    \n    public int numMatchingSubseq(String s,
```\nclass Solution {\n    \n    \n    /* Approach: For every word, check if it is subsequence of input string */\n    \n    public int numMatchingSubseq(String s, String[] words) {\n        \n        String inputString = s;\n        int count = 0;\n        \n        // Check for every words in array\n        \n        for (String word: words) {\n            \n             // Check if word is subsequence of input string\n                 \n            if (checkSubsequence(word, inputString)) {\n                count = count + 1;\n            }\n            \n        }\n        \n        return count;\n    }\n    \n    \n    /* Helper function to check if given word is sub sequence of given input string */\n    \n    private boolean checkSubsequence (String word, String inputString) {\n        \n        int prevCharIndex = 0;   // It will store the index of input String where previous char was found\n        \n        /*  So, the curr character should be found after this index for maintaining subsequence order  */\n                \n        for (char ch : word.toCharArray()) {\n            \n            int index = inputString.indexOf(ch, prevCharIndex);   // search for char after prev char found index\n            \n            // If index == -1 means char not found, else found at index i.\n            \n            if (index == -1) {\n                return false;\n            }\n            \n            prevCharIndex = index + 1;   // set the prevCharIndex to current found char index + 1 for next search\n            \n            // We do index + 1 as maybe duplicate elements consider this same index twice, so increment by 1.\n            \n        }\n        \n        return true;   // Every chars traversed and found, return true.\n        \n    }\n    \n    \n}\n```\n\n**Please Upvote if you find it helpful. Happy Coding!**\n\n
['String', 'Java']