Search
⌘K

Leetcode 1671. Minimum Number of Removals to Make Mountain Array

Find the minimum removals by keeping the longest strict bitonic subsequence (strictly increasing then strictly decreasing with the peak not at an endpoint). Compute for each index the longest increasing subsequence ending there and the longest decreasing subsequence starting there, combine lengths for valid peaks, and subtract the maximum bitonic length from n.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.