yeah, nor they mentioned that multiple occurences are possible, I am not supposed to keep looking up in the comment section for clarification.
smallest positive integer which does not occur among the chosen elements
We are choosing a particular subset from the given set and checking MEX for that subset
Sorry, it was a typing mistake.
Even I made the same mistake
They give two statements themselves
Editorial : MEX of a sequence is the smallest positive integer not present in the sequence.
Problem: MEX, i.e. the smallest positive integer which does not occur among the chosen elements.
These two statement are not similiar
@taran_1407
The answer in this case is -1.
MEX of a sequence is the smallest positive integer not present in the sequence.
So in subsequence {4,5,6,7,9,10} it will be 1 as 1 is the smallest positive number not present in the subsequence.
Please explain your approach. Did you consider multiple occurence of integers?
I think the problem statement could have been made a little more clear with 1 or 2 more input-output examples.
How though?
I made the same incorrect assumption and ended up solving only one question :’(
Unless specified that array elements are unique, you ought to assume that only.
You are right bro
MEX, i.e. the smallest positive integer which does not occur among the chosen elements
M=3
Given set = {1, 2, 4}
Acc to answer chosen set is {1, 2, 3}. So the elements which donot occur among the chosen elements are : NULL
Smallest among NULL is 3? Please explain
When you are using the word among the elements , it signify that you are using some lower and upper bound
made the same assumption
Because
Editorial : MEX of a sequence is the smallest positive integer not present in the sequence.
Problem: MEX, i.e. the smallest positive integer which does not occur among the chosen elements.
chosen elements is a subset of sequence
Yeah, but which elements you chose depends on you.
Subsequence is also a sequence. Isn’t it?
even I thought that we need to pick elements on our own from the sequence. and I think someone in the comments even said that it’s okay to pick it