inversion counters in an array