inversions problems