Count Inversion Leetcode Problem 34