Problem 3107 · Medium

Minimum Operations to Make Median of Array Equal to K

Sort the numbers and pay only for the half of the array that must move so the median lands on k.

Open the interactive visualisation