NeetCode #289LC-1898MediumBinary Search
← Back to All Problems#289 · #1898 · Maximum Number of Removable Characters(可移除字符的最大数目)
📌 Problem Statement & Constraints
You are given strings
s and p, and an array removable of indices into s. You may remove the characters at the first k indices of removable. Return the largest k such that p is still a subsequence of the remaining string. Constraints: 1 <= p.length <= s.length <= 10^5, 0 <= removable.length < s.length; all indices are distinct.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!