Problem 2826 · Medium
Keep the longest non-decreasing subsequence of values 1 to 3 and delete everything else.
Open the interactive visualisation