Simple Java Solution O(n)
Intuition\n Describe your first thoughts on how to solve this problem. \n1. It initializes an integer array a with the same length as the input array pref.\n2. 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n1. It initializes an integer array a with the same length as the input array pref.\n2. It assigns the first element of a as the same as the first element of pref.\n3. Then, it iterates through the elements of pref starting from index 1.\n4. For each element pref[i], it calculates pref[i-1] XOR pref[i] and assigns the result to a[i].\n5. Finally, it returns the array a.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Initialize a new array a with the same length as pref to store the XOR results.\n2. Assign the first element of a as pref[0].\n3. Iterate through pref starting from index 1.\n4. For each element pref[i], calculate pref[i-1] XOR pref[i] and assign the result to a[i].\n5. Return the array a containing the XOR results.\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] findArray(int[] pref) {\n        int[]a = new int[pref.length];\n        a[0] = pref[0];\n        for(int i = 1; i<pref.length;i++){\n            a[i] = pref[i-1] ^ pref[i];\n        }\n        return a;\n    }\n}\n```
['Array', 'Bit Manipulation', 'Java']