Company: Amazon_july
Difficulty: medium
Median of Subarray Uniqueness Problem Description The uniqueness of an array of integers is defined as the number of distinct elements present. For example, the uniqueness of [1, 5, 2, 1, 3, 5] is 4, element values 1, 2, 3 and 5. For an array initialArray of n integers, the uniqueness values of its subarrays is generated and stored in another array, call it subarray_uniqueness . Find the median of the generated array subarray_uniqueness . Notes: 1. The median of a list is defined as the middle value of the list when it is sorted in non-decreasing order. If there are multiple choices for median, the smaller of the two values is taken. For example, the median of [1, 5, 8] is 5, and of [2, 3, 7, 1] is 3. 2. A subarray is a contiguous part of the array. For example, [1, 2, 3] is a subarray of [6, 1, 2, 3, 5] but [6, 2] is not. Function Description: Complete the function getMedianOfSubarrayUniqueness in the editor below. getMedianOfSubarrayUniqueness has the following parameter: int initial