Count Inversion Leetcode Problem 236