the question is vague. i am giving solution to two different problems as i understand it
i) array A: [x1,....xk,..xn], B:[x1,..(xk missing)...xn]
solution: simple running xor of both arrays with leave xk(that's why i think this is not the question)
ii) A: [x1...xk...xn] V:[x1...xk2(instead of xk)...xn]
solution:
1. run xor, that leaves xk(xor)xk2; find the first set of this xorsum bit from right -> this is one of the possible many locations where xk and xk2 differs 2; store this index position, lets say it's i. (formula to find last set bit is x & -x)
2. create int X=0, Y=0 which will hold final results(xk and xk2); for all elements in A and B, right shift them by i position and check if bitwise ANDing them with 1 returns true. Depending on the true/false outcome, xorsum them with X, Y
Once you are done, X & Y will have xk & xk2