Is there a straightforward way to characterise the number of inversions in an array of length N
having distinct elements, each element an integer from 1 to N
?
It's for a constraint optimization problem, where the number of inversions needs to be minimized.