Read n and the array elements. Use merge sort to split the array into halves. Count inversions in the left half and right half. Merge the halves and count cross-inversions when right element < left ...
Contribute to leonjohn/R-Ignite-2026-Workshop development by creating an account on GitHub.