Problem 2449 · Hard

Minimum Number of Operations to Make Arrays Similar

Each operation moves two units between elements of the same parity, so match odd values and even values separately in sorted order.

Open the interactive visualisation