Implemented a straightforward yet computationally intensive method to count inversions. By comparing each element with every other element that follows it in the array, this method identifies and tallies inversion pairs, encapsulating the essence of brute force techniques.
Merge Sort and Count:
Adopted a more sophisticated and efficient approach, leveraging the merge sort algorithm's divide-and-conquer strategy. This method not only sorts the array but also counts inversions in three critical steps