Easy to understand || Using map and sorting || c++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n^2 log n)\n\n- Space complexity: O(n)\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> recoverArray(vector<int>& nums) {\n        int n=nums.size(),a=INT_MAX,b=INT_MAX;\n        sort(nums.begin(),nums.end());\n        for(int i=1;i<n;i++){\n            int k=(nums[i]-nums[0])%2==1 ? -1:(nums[i]-nums[0])/2;\n            if(k<=0) continue;\n\n            map<int,int> mp;\n            vector<int> v;\n            for(int j=0;j<n;j++){\n                if(mp.find(nums[j])!=mp.end()){\n                    v.push_back(nums[j]-k);\n                    mp[nums[j]]--;\n                    if(mp[nums[j]]==0) mp.erase(nums[j]);\n                } else {\n                    mp[nums[j]+2*k]++;\n                }\n            }\n\n            if(v.size()==n/2 && mp.size()==0) return v;\n        }\n\n        return {};\n    }\n};\n```
['Array', 'Hash Table', 'Math', 'Greedy', 'Sorting', 'Enumeration', 'C++']