# Codility Inversion Count

#### Posted on November 25, 2013

##### Last updated on November 24, 2013

This is a solution to the Codility problem Inversion Count. An inversion is a tuple $$(p,q)$$ where $$p < q$$ and $$A[p] > A[q]$$ for a given array $$A$$.

The idea is to use a modified mergesort that counts the number of inversion pairs. In Java:

Markdown SHA1: 65c90ea51bfb1a2dbe9b002bb557d6795bf7ec6a