Count the reverse pairs in an integer array.
Unlock detailed company stats for this questionUpgrade
Reverse Pairs. Given an integer array nums, return the number of reverse pairs. A reverse pair is a pair (i, j) such that 0 <= i < j < nums.length and nums[i] > 2 * nums[j].
Example: nums = [1,3,2,3,1] -> 2. The reverse pairs are (1,4) since 3 > 21 and (3,4) since 3 > 21.
Format · eBay offline interview, 30 minutes.
Community answers
No answers contributed by the community yet.
Related questions
Reverse the first k elements of an array.Find the maximum product of any two integers in an array.Given an array of integers, find the first duplicate.Related courses

Course

Course
Course
