2433.cpp (212B)
1 class Solution { 2 public: 3 vector<int> findArray(vector<int> &pref) { 4 int mask = 0; 5 for (int &n : pref) { 6 n ^= mask; 7 mask ^= n; 8 } 9 return pref; 10 } 11 };