Company: ubs_24oct
Difficulty: medium
Merge Sort Counts Problem Description Implement a modified merge sort algorithm that counts specific inversions during the sorting process: The algorithm takes an array of unique integers as input and returns the sorted array. For an array with n elements: If the array has fewer than 2 elements, it is returned as is. Otherwise, it is split into left and right arrays. The left array contains the first half of elements (including the middle element if n is odd). The right array contains the remaining elements. The algorithm recursively sorts both arrays. During the merging process: A count is maintained for each element in the input array (initially 0). Whenever an integer k from the right array is merged before any element from the left array, 1 is added to the count. Return the maximum count value after the merge sort algorithm completes. Complete the function largestCountValue in the editor with the following parameter(s): int arr[] : array of distinct elements Returns: int : the maxi