Array inversions count