You are given a string source, a string pattern, and an integer array targetIndices sorted in ascending order.
You can choose to remove characters from source at indices present in targetIndices.
Return the maximum number of indices from targetIndices that can be removed such that pattern remains a subsequence of source after all removals.
Constraints:
source.length
pattern.length
targetIndices.length
targetIndices is sorted in ascending order.
targetIndices contains distinct elements in the range
source and pattern consist only of lowercase English letters.
pattern is guaranteed to be a subsequence of source.
You are given a string source, a string pattern, and an integer array targetIndices sorted in ascending order.
You can choose to remove characters from source at indices present in targetIndices.
Return the maximum number of indices from targetIndices that can be removed such that pattern remains a subsequence of source after all removals.
Constraints:
source.length
pattern.length
targetIndices.length
targetIndices is sorted in ascending order.
targetIndices contains distinct elements in the range
source and pattern consist only of lowercase English letters.
pattern is guaranteed to be a subsequence of source.