Loading repovive.com/problems/classics/60
Given an array, process point updates. After each update, print the minimum non-negative integer that is missing from the array.
4 4 0 1 3 3 4 2 1 5 2 0 3 1
The MEX values after the four updates are 4, 0, 1, and 3.
4 0 1 3
3 3 1 2 3 1 0 2 0 3 0
After each update, the value 1 is missing from the array, so every printed MEX is 1.
1 1 1
2 2 0 1 1 1 2 0
After removing the only 0, the MEX is 0; after restoring 0, the MEX is 2.
0 2