Problem 2826 · Medium

Sorting Three Groups

Keep the longest non-decreasing subsequence of values 1 to 3 and delete everything else.

Open the interactive visualisation