Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 895 Bytes

0792-number-of-matching-subsequences.adoc

File metadata and controls

34 lines (23 loc) · 895 Bytes

792. Number of Matching Subsequences

{leetcode}/problems/number-of-matching-subsequences/[LeetCode - Number of Matching Subsequences^]

Given string S and a dictionary of words words, find the number of words[i] that is a subsequence of S.

Example :
Input:
S = "abcde"
words = ["a", "bb", "acd", "ace"]
Output: 3
Explanation: There are three words in words that are a subsequence of S: "a", "acd", "ace".

Note:

  • All words in words and S will only consists of lowercase letters.

  • The length of S will be in the range of [1, 50000].

  • The length of words will be in the range of [1, 5000].

  • The length of words[i] will be in the range of [1, 50].

link:{sourcedir}/_0792_NumberOfMatchingSubsequences.java[role=include]