Python3 Readable Short solution
Intuition\nSame intuition as given in the Hints section\n\n# Approach\nMake an extra array arr containing the first element of prev. Then append prev[i] ^ prev[
# Intuition\nSame intuition as given in the Hints section\n\n# Approach\nMake an extra array `arr` containing the first element of `prev`. Then append `prev[i] ^ prev[i-1]` to the array in a loop from `1` to `N-1`. \n\n# Complexity\n- Time complexity:\nO(N) as it implements a single for loop from 1 to N-1\n\n- Space complexity:\nO(N) as it takes an extra array of length N\n\n# Code\n```\nclass Solution:\n    def findArray(self, pref: List[int]) -> List[int]:\n        arr = [pref[0]]\n        for i in range(1, len(pref)):\n            arr.append(pref[i] ^ pref[i - 1])\n        return arr\n```
['Python3']