Count Inversion Leetcode Problem 125