Update CountInversions.java

Clean up code