#2826

Sorting Three Groups

specialist · 985 · lc medium +32 · 42.9% accepted · 525 likes · top 24%

Description

An integer array nums is given, where every element is 1, 2, or 3. In each operation, you may remove any element. Return the minimum number of operations to make nums non-decreasing.

Code

1
2
3