#3316

Find Maximum Removals From Source String

expert · 1030 · lc medium +32 · 39.3% accepted · 165 likes · top 19%

Description

You are given string source of size n, string pattern (a subsequence of source), and sorted integer array targetIndices. An operation removes the character at some idx in targetIndices from source if pattern remains a subsequence afterward. Return the maximum number of operations.

Code

1
2
3