Reverse Pairs Leetcode Solution