Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The first move keeps the parity of the element as it is.
The second move changes the parity of the element.
Since the first move is free, if all the numbers have the same parity, the answer would be zero.
Find the minimum cost to make all the numbers have the same parity.