Solve the inversion count arrangement problem with a O(n^2) solution.