logo
Interview
    Interview Guide
    Coding Problems List
Sponsored: Coursera
Problems

Reverse Pairs

Problem

For an array A, if i < j, and A [i] > A [j], called (A [i], A [j]) is a reverse pair.

Return total of reverse pairs in A.

Example

Given A = [2, 4, 1, 3, 5] , (2, 1), (4, 1), (4, 3) are reverse pairs. return 3

Online Judge