Count Inversion Leetcode Problem 217