Inversion Count In Leetcode Contest Solution