✅ Easy approach
Intuition\nRecall the concepts of XOR.\n\n# Approach\n\na ^ b = c\n\nThen the following relations will also be true,\n\na ^ c = b\nb ^ c = a\n\n\n# Complexity\n
# Intuition\nRecall the concepts of XOR.\n\n# Approach\n```\na ^ b = c\n```\nThen the following relations will also be true,\n```\na ^ c = b\nb ^ c = a\n```\n\n# Complexity\nO(n)\n\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int n = pref.size();\n        vector<int> res;\n\n        res.push_back(pref[0]);\n        for(int i=1; i<n; i++){\n            res.push_back(pref[i-1]^pref[i]);\n        }\n        \n        return res;\n    }\n};\n```
['Bit Manipulation', 'C++']