Simple C++ solution
```\nclass Solution {\npublic:\n    vector findArray(vector& pref) {\n        int n = pref.size();\n        vector ans(n);\n        ans[0] = pref[0];\n        f
```\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int n = pref.size();\n        vector<int> ans(n);\n        ans[0] = pref[0];\n        for(int i = 1;i<n;i++)\n            ans[i] = pref[i-1] ^ pref[i];\n        return ans; \n    }\n};
['Bit Manipulation', 'C']