Explained Intuition for XOR || 2 Line Solution
XOR PROPERTY : \n\n\tFor a,b,c if (a ^ b = c) then (a ^ c = b), (b ^ c = a) \n    let variable XOR store ,xor of all previous elements of our ans array.\n    le
**XOR PROPERTY :** \n```\n\tFor a,b,c if (a ^ b = c) then (a ^ c = b), (b ^ c = a) \n    let variable XOR store ,xor of all previous elements of our ans array.\n    let ans[i] be x. //we have to find ans[i].\n      =>XOR ^ x = p[i] //XOR property\n      => x = p[i] ^ XOR \n```\nWe have to insert p[i] ^ XOR in our ans array!\n    \nApproach 1: forward iteration\n```\nvector<int> findArray(vector<int>& p) { \n\tint n = p.size();\n\tint XOR = 0;\n\n\tfor(int i = 0; i < n; i++) \n\t{\n\t\tp[i] ^= XOR; //ans[i] = p[i] ^ XOR\n\t\tXOR ^=  p[i]; //update XOR to include curr element as well\n\t}\n\treturn p;\n}\n```\n   2 lines! - we know p[0] will be 1 so we can save one iteration!\n   \n    vector<int> findArray(vector<int>& p) {\n        for(int i=1,XOR=p[0]; i<size(p); XOR^=p[i++])   p[i] ^= XOR;\n        return p;\n    }\nAPPROACH 2 : backward itertion without  XOR variable! : [@lee215](https://leetcode.com/problems/find-the-original-array-of-prefix-xor/discuss/2678904/JavaC%2B%2BPython-Easy-and-Concise-with-Explantion) discussion: same intuition.\n
['C']