Simple Approach, C++ Beats 90% ✅✅
Approach\n Describe your approach to solving the problem. \nin problem statement it is given that :-\npref[i] = arr[0]^arr[1]^arr[2]......arr[i-1]^arr[i]\nwe ca
# Approach\n<!-- Describe your approach to solving the problem. -->\nin problem statement it is given that :-\n**pref[i] = arr[0]^arr[1]^arr[2]......arr[i-1]^arr[i]**\nwe can write the statement in another way :-\n**arr[i] =  arr[0]^arr[1].....arr[i-2]^arr[i-1]^pref[i]**\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 n = pref.size(),xorvalue = pref[0];\n        for(int i = 1;i<pref.size();i++)\n        {\n           int tmp = xorvalue^pref[i];\n           pref[i] = tmp;\n           xorvalue = xorvalue^pref[i];\n        }\n        return pref;\n    }\n};\n```\n![upvote.jpg](https://assets.leetcode.com/users/images/94d900a8-78fe-4548-874a-52de0e627eb3_1688452375.9702466.jpeg)\n
['Bit Manipulation', 'C++']