Problem 2870 · Medium

Minimum Number of Operations to Make Array Empty

Each value is removed in groups of two or three, so a value appearing c times needs ceil(c / 3) operations unless c is 1.

Open the interactive visualisation