Xor profit problem

not able to understand o(n) approach even after reading tutorial…

Can you please post the editorial code here so that I can explain it?