Problem 2856 · Medium

Minimum Array Length After Pair Removals

In a sorted array, a value that fills more than half the slots forces leftovers; otherwise the length is only the parity of n.

Open the interactive visualisation