Minimum length of the subarray required to be replaced to make frequency of array elements equal to N / M
Given an array arr[] of size N consisting of only the first M natural numbers, the task is to find the minimum length of the subarray that is required to be replaced such that the frequency of array elements is N / M. Note: N is a multiple of M. Examples: Input: M = 3, arr[] = {1, 1, 1, 1, 2, 3}Outp