Count Inversion In Array Leetcode Question