1898. Maximum Number of Removable Characters
Description
**Input:** s = "abcacb", p = "ab", removable = [3,1,0]
**Output:** 2
**Explanation**: After removing the characters at indices 3 and 1, "a~~**b**~~c~~**a**~~cb" becomes "accb".
"ab" is a subsequence of "**a**cc**b**".
If we remove the characters at indices 3, 1, and 0, "~~**ab**~~c~~**a**~~cb" becomes "ccb", and "ab" is no longer a subsequence.
Hence, the maximum k is 2.**Input:** s = "abcbddddd", p = "abcd", removable = [3,2,1,4,5,6]
**Output:** 1
**Explanation**: After removing the character at index 3, "abc~~**b**~~ddddd" becomes "abcddddd".
"abcd" is a subsequence of "**abcd**dddd".ac
Previous1897. Redistribute Characters to Make All Strings EqualNext1899. Merge Triplets to Form Target Triplet
Last updated