Reverse Pairs Count
Given an integer array arg1, return the number of reverse pairs in the array.
A reverse pair is a pair of indices (i, j) such that:
0 <= i < j < arg1.lengtharg1[i] > 2 * arg1[j]
Examples
Input: [1,2,3]
Output: 0
Input: [1,3,2,3,1]
Output: 2
Hints
A brute-force check of every pair is correct but too slow for large inputs.
During merge sort, the left and right halves are sorted; count cross-half pairs before merging.
When checking `arg1[i] > 2 * arg1[j]`, use 64-bit arithmetic in languages where integer overflow is possible.
Reverse Pairs Count
Given an integer array `arg1`, return the number of **reverse pairs** in the array.