XOR is self-inverting & associative & commutative :)
Java\njava\npublic int[] findArray(int[] pref) {\n        int[] result = new int[pref.length];\n        result[0] = pref[0];\n        for (int i = 1; i < pref.l
##### Java\n```java\npublic int[] findArray(int[] pref) {\n        int[] result = new int[pref.length];\n        result[0] = pref[0];\n        for (int i = 1; i < pref.length; ++i) {\n            result[i] = pref[i] ^ pref[i - 1];\n        }\n        \n        return result;\n    }\n```\n\n##### C++\n```cpp\npublic:\n    vector<int> findArray(vector<int>& pref) {\n        vector<int> result(pref.size());\n        result[0] = pref[0];\n        for (int i = 1; i < pref.size(); ++i) {\n            result[i] = pref[i] ^ pref[i - 1];\n        }\n\n        return result;\n    }\n```
['C', 'Java']