C++ || CLEAN SHORT CODE || GREEDY
\n\n# Code\n\nclass Solution {\npublic:\n    vector<int> recoverArray(vector<int>& a) {\n        sort(a.begin(),a.end());\n        vector<int> v;\n        for(i
\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> recoverArray(vector<int>& a) {\n        sort(a.begin(),a.end());\n        vector<int> v;\n        for(int i=1;i<=a.size()/2;i++)\n            if(a[i]-a[0]!=0 && a[i]-a[0]!=1 && (a[i]-a[0])%2==0) v.push_back(a[i]-a[0]);\n        \n        int n=a.size()/2;\n        for(auto i : v)\n        {\n            vector<int> r,f;int c=0;\n            unordered_map<int,int> p;\n            for(int j=0;j<2*n;j++)\n            {\n                if(p.count(a[j]-i)){\n                  f.push_back(a[j]);\n                  p[a[j]-i]--;\n                  if(p[a[j]-i]==0) p.erase(a[j]-i);\n                }\n                else\n                {\n                    p[a[j]]++;\n                    r.push_back(a[j]);\n                }\n            }\n            bool b=1;\n            if(f.size()==r.size())\n            {\n                for(int j=0;j<n;j++)\n                if(f[j]-r[j]!=i) b=0;\n            \n                if(b)\n                {\n                for(int j=0;j<n;j++) r[j]=(r[j]+i/2);\n                return r;\n                }\n            }\n        }   \n        return {};\n    }\n};\n```
['C++']