text and a list words. A word is hidden in text if you can get it by crossing out some letters of text (possibly none) without reordering the rest.
Return how many entries of words are hidden in text. If a word appears in the list several times, each occurrence counts separately.text='telegram', words=['tea', 'gram', 'late', 'tg', 'mart', 'ee'] → 4
"telegram" hides "tea" (t-e-…-a), "gram", "tg" and "ee". In "late" the t would have to come after the a, and in "mart" nothing follows the m.
text='abc', words=['abc', 'abc', 'cba'] → 2
Repeated words are each counted; "cba" goes in reverse order and does not fit.
text='zz', words=['zzz', 'z'] → 1
text) ≤ 5·10⁴words) ≤ 5000words[i]) ≤ 50text='telegram', words=['tea', 'gram', 'late', 'tg', 'mart', 'ee']
4
Run checks the first 3 tests in your browser. Submit checks all 58 tests on the server, hidden ones included.