Global And Local Inversions Leetcode