We’re preparing your current view and syncing the latest data.
Given an integer array nums, return the number of reverse pairs in the array. A reverse pair is defined as (i, j) where 0 <= i < j < nums.length and nums[i] > 2 * nums[j]. The problem requires an efficient solution better than O(n^2).
An array of integers nums.
An integer representing the number of reverse pairs in the array.
1 <= nums.length <= 5 * 10^4, -2^31 <= nums[i] <= 2^31 - 1