Available question text
Given an array of values in {1,2,3}, remove the fewest elements so the remaining sequence is non-decreasing. This is equivalent to maximizing the length of a non-decreasing subsequence (or a subsequence of the form 1*2*3*), which can be solved with a small-state DP in O(n) time.
Related questions
Continue with questions that share topics or the same question type.
- Actors and Directors Who Cooperated At Least Three Times
Coding
- Alert Using Same Key-Card Three or More Times in a One Hour Period
Coding
- Alternating Groups I
Coding
- Alternating Groups II
Coding · Array · Sliding Window
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2826. Sorting Three Groups
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source