You are given two strings s and p, where p is a subsequence of s, along with an array of distinct integers removable representing indices in s.
You want to find the maximum integer k (removable.length) such that after removing the characters from s at the indices removable[0], removable[1], …, removable[k - 1], p is still a subsequence of s.
Return the maximum possible value of k.
Note: A subsequence of a string is a new string formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters.
Constraints:
p.length s.length
removable.length s.length
removable[i] s.length
p is a subsequence of s.
s and p both consist of lowercase English letters.
The elements in removable are distinct.
You are given two strings s and p, where p is a subsequence of s, along with an array of distinct integers removable representing indices in s.
You want to find the maximum integer k (removable.length) such that after removing the characters from s at the indices removable[0], removable[1], …, removable[k - 1], p is still a subsequence of s.
Return the maximum possible value of k.
Note: A subsequence of a string is a new string formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters.
Constraints:
p.length s.length
removable.length s.length
removable[i] s.length
p is a subsequence of s.
s and p both consist of lowercase English letters.
The elements in removable are distinct.