The weight of an array is defined as the maximum number of occurrences of any integer in the array.
Given an array of positive integers ‘k’,find the smallest possible length of a subarray of the array ‘k’ that has the same weight as ‘k’.integers should remain contiguous in the subarray
Constraints
k.length will be between 1 and 50,000
k[i] will be an integer between 0 and 49,999