Problem 2869 · Easy

Minimum Operations to Collect Elements

Remove elements from the end of the array and track which values 1 to k are still missing until the set is empty.

Open the interactive visualisation