Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 421 Bytes

File metadata and controls

19 lines (13 loc) · 421 Bytes

16.Number of Matching Subsequences

Description

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".

From

LeetCode