Inversion Count In Leetcode Two Sum Python