3 ms·
Let's try an example with n=4: 1 ^ 2 ^ 3 ^ 4 ^ A[0] ^ A[1] ^ A[2] ^ A[3] It might be early in the morning and I am missing something, but it has n-1 as its la
by ml_giant 6y ago
Let's try an example with n=4:
1 ^ 2 ^ 3 ^ 4 ^ A[0] ^ A[1] ^ A[2] ^ A[3]
It might be early in the morning and I am missing something, but it has n-1 as its last index. Any insight is appreciated :)
Edit: There is a missing number in the array, thus its last index is n-2. Thanks for the correction, OP.
- bonzini 6y agoBut there are only 3 items in the array (for example 1, 2 and 4). So the last valid index is 2.
- ml_giant 6y agoAh. I was about to make an edit to my comment as you are correct :) Thanks!
- j-pb 6y agoPremise: A is containing all values in range [1, 4] except one: Let's say that, without loss of generality: > 1 ^ 2 ^ 3 ^ 4 ^ A[0]=1 ^ A[1]=2 ^ A[2]=3 ^ A[3]=4 However, A is now missing no value. Contradiction. ∎