TIME O(n), SPACE O(1) || C++ || PREFIX XOR || MOST OPTIMIZED
Code\n\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int x = pref[0],y;\n        for(int i = 1; i < pref.size(); i++){\n  
# Code\n```\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int x = pref[0],y;\n        for(int i = 1; i < pref.size(); i++){\n            y = pref[i];\n            pref[i] = (pref[i]^x);\n            x = y;\n        }\n        return pref;\n    }\n};\n```
['Array', 'Bit Manipulation', 'C++']