Easiest python solution with explanation
Intuition\n Describe your first thoughts on how to solve this problem. \nfirst i thought of the brute force approach to like create a new array and arr[i] will 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nfirst i thought of the brute force approach to like create a new array and arr[i] will be pref[i-1]^pref[i]. Then thought a was to reduce space complexity from o(n) to o(1). And came up with a solution to use a variable to store the previous element\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\nStore the first element of prefix array in a variable say t.\nNow in each round of loop store the value of that element in a temp variable .\nThe value of original array will be xor with previous element that is t ^ current value\nSo we got the value of original array at i and just replace the value of t with temp variable and go one  \n\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:\n    def findArray(self, pref: List[int]) -> List[int]:\n        if len(pref) <= 1: return pref\n\n        t = pref[0]\n        for i in range(1 , len(pref)):\n            x = pref[i]\n            pref[i] = t^pref[i]\n            t = x\n        return pref\n```
['Python3']