Company: Growth jockey_10oct
Difficulty: medium
Minimum Operations to Achieve MEX k Problem Description GrowthJockey's Data Engineering team is analyzing sprints where each feature task has an associated tag ID. You are given an array a of length n , where each element represents a feature tag ID (from 0 to n). You're also given a target number k , which represents the desired MEX — the smallest non-negative integer not present in the array. In one operation, the team can reassign any one task's tag (change any element a[i] ) to any value in the range [0, n] . Your goal is to determine the minimum number of such operations required so that the array's MEX becomes exactly equal to k . Definition MEX(a) = the smallest non-negative integer that is not present in a . Input Each test contains multiple test cases. The first line contains an integer t — the number of test cases. For each test case: The first line contains two integers n and k — the length of the array and the required MEX(a). The second line contains n integers a_1, a_2, .