Given an array of integers, count the number of inversions. An inversion is defined as a pair (i, j) such that i < j and arr[i] > arr[j]. Use a modified merge sort to achieve O(n log n) time…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.