EASY - BEGINNER FRIENDLY CODE || Prefix xor
Intuition\nThe code essentially transforms the input vector by XORing each element with the previous one.\n\n# Approach\n1. Initialize a variable prev with the 
# Intuition\nThe code essentially transforms the input vector by XORing each element with the previous one.\n\n# Approach\n1. Initialize a variable prev with the value of the first element in the pref vector.\n2. Create an auxiliary variable aux to temporarily store the result of the XOR operation.\n3. Iterate through the pref vector starting from the second element (index 1).\n3. For each element at index i, calculate auxiliary/temporary value by performing a bitwise XOR operation (^) between prev and the current element pref[i]. Update the prev variable to be the current element pref[i] for the next iteration. Update the current element in the pref vector with the calculated aux value, effectively modifying the vector in place.\n4. Repeat step 3 for all elements in the pref vector.\nFinally, return the modified pref vector.\n\n# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        int prev = pref[0];// prev -- store the (i-1)th value of original vector\n        int aux; // temporary variable\n        for(int i = 1;i<pref.size();i++){\n            aux=prev^pref[i];\n            prev = pref[i];\n            pref[i] = aux;\n        }\n        return pref;\n    }\n};\n```
['Bit Manipulation', 'C++']