She uses each of the colors 1…N exactly once, although just as before, some colors might end up being completely covered up by the end.
This means that in a sequence such as [1, 1, 1, 2] with N = 4, the answer should be 2, not 1, because 1 and 2 must be in the only meaningful round while 3 and 4 must be in the preliminary round so that they would also be painted.
However, when I tested this example input, the answer I got was 1 rather than 2. So, which is incorrect: the problem statement, the official solution, or my interpretation?
If there resides an empty space between the endpoints of a color’s interval, shouldn’t the answer be -1, because it must’ve been colored? Because if that is the case, test cases such as test case 2 in the test data should be -1 (the sequence starts with $[52, 0, 0, …]), but the answer is 5.