Minimum Operations to Make All Array Elements Equal
For each query value, split the sorted numbers at that value and use prefix sums to total the raise and lower costs.
For each query value, split the sorted numbers at that value and use prefix sums to total the raise and lower costs.