MEX (Minimum Excluded) in Competitive Programming
MEX of a sequence or an array is the smallest non-negative integer that is not present in the sequence. Example: If we have a sequence S[] = {1,2,0,4,5} then MEX (S) = 3.If we have a sequence S[] ={2,0,3,10} then MEX (S) = 1.If we have a sequence S[] ={1,2,3,4,5} then MEX (S) = 0.Note: The MEX of an