leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

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 };