Challenge: Number of Inversions
Solve the Number of Inversions Problem.
We'll cover the following
Problem
Number of Inversions Problem
Compute the number of inversions in a sequence of integers.
Input: A sequence of integers .
Output: The number of inversions in the sequence—that is, the number of indices such that .
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.