Prefix XOR
Intuition\nTo compute the current element we need the prefix xor of previous elements.\norig[i] = prefix[i - 1] xor prefix[i]\n Describe your first thoughts on 
# Intuition\nTo compute the current element we need the prefix `xor` of previous elements.\n`orig[i] = prefix[i - 1] xor prefix[i]`\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nWe maintian a variable `x` which is the prefix xor of all the elements before it.\n\nAfter the operation the resultant array will be the original array.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: *`O(n)`*\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: *`O(1)`*\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int x = pref[0], n = pref.size();\n        for(int i = 1; i < n; i++) {\n            pref[i] = x ^ pref[i];\n            x ^= pref[i];\n        }\n        return pref;\n    }\n};\n```
['Array', 'Prefix Sum', 'C++']