New Array Subarray Solution

New Array Subarray PrepBuddy gave you an array of length NN: A1,A2,..,ANA1,A2,..,AN. And, this array is composed of integers between 11 to MM. Construct a new array of length NN: A′1,A′2,..,A′NA1′,A2′,..,AN′, such that: New array A′A′ has integers between 1 to MM. The number of i where Ai!=A′iAi!=Ai′ is not more than KK. XX is … Read more