[C++] Straightforward & Clean Solution
Complexity\n- Time complexity:\nO(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:\nO(n)\n Add your space complexity here, e.g. O(n) \n\n# 
# Complexity\n- Time complexity:\n$$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n$$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findArray(vector<int>& p) {\n        int n = p.size(), cur = p[0];\n        vector<int> result(n, cur);\n        for(int i = 1; i < n; i++)\n            result[i] = cur ^ p[i], cur = p[i];\n        return result;\n    }\n};\n```
['C++']