2 Easy C++ solution || Beginner and advanced approach || Beats 90% !!
From the \n\n# Code\n\n// Beginner approach\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int ans = 0;\n        vector<int
From the \n\n# Code\n```\n// Beginner approach\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int ans = 0;\n        vector<int> a;\n        for(int i=0; i<pref.size(); i++){\n            a.push_back(ans^pref[i]);\n            ans=pref[i];\n        }\n        return a;\n    }\n};\n\n// Better approach (Not that advanced tbh)\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        for(int i=pref.size()-1; i>0; i--){\n            pref[i]^=pref[i-1];\n        }\n        return pref;\n    }\n};\n```
['C++']