c++
\n\n"""\n\nclass Solution {\n    \nprivate:\n  bool solve(multisetms,vector&ans,int k){\n      \n     while(!ms.empty()){\n         int low=ms.begin();\n       
\n\n"""\n\nclass Solution {\n    \nprivate:\n  bool solve(multiset<int>ms,vector<int>&ans,int k){\n      \n     while(!ms.empty()){\n         int low=*ms.begin();\n         int high=low+2*k;\n          \n          if(ms.find(high)==ms.end())return false;\n          \n          ans.push_back(low+k);\n          \n          ms.erase(ms.begin());\n          auto it=ms.find(high);\n          ms.erase(it);   \n      } \n      return true;    \n  }  \n    \npublic:\n    \n    \n    vector<int> recoverArray(vector<int>& arr) {\n    sort(arr.begin(),arr.end());\n    int n=arr.size();\n        multiset<int>ms(arr.begin(),arr.end());\n        \n    int low=arr[0];\n        \n        for(int i=1;i<n;i++){\n            vector<int>ans;\n            int high=arr[i];\n            if((high-low)%2==0){\n            int k=(high-low)/2;\n         if(k&&solve(ms,ans,k)){\n             return ans;\n         }   \n   \n        }\n        }\n        \n        return {};\n    }\n    \n};\n\n"""
[]