Question Name: PermMissingElem or PermMissingElement
The main challenge of this question is the XOR operations: X^X=0, and 0^X=X. Logically, the addition and subtraction operations also are able to do this work. But taking the overflow in computer into consideration, they become a very bad choice.
length = len(A)
xor_sum = 0
for index in range(0, length):
xor_sum = xor_sum ^ A[index] ^ (index + 1)
return xor_sum^(length + 1)