C++ || multiset || BRUTE FORCE
Approach\nstep 1:- Sort the array.\nstep 2:- The smallest element will be the first element of lower array. So find every possible of values of K with respect t
***Approach***\nstep 1:- Sort the array.\nstep 2:- The smallest element will be the first element of lower array. So find every possible of values of K with respect to the smallest element.\nstep 3:- If the total number of count is equal to the size of the array for any K then simply return the array.\n\n\n```\nclass Solution {\npublic:\n    vector<int> recoverArray(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int n=nums.size();\n        for(int i=1;i<n;i++){\n            int k=nums[i]-nums[0];\n            if(k==0 || k%2!=0){\n                continue;\n            }\n\t\t\t// multiset to avoid the problem of duplicate elements in the array.\n            multiset<int> ms(nums.begin(),nums.end());\n            int cnt=0;\n            vector<int> ans;\n            while(!ms.empty()){\n                int low=*ms.begin();\n                int high=low+k;\n                if(ms.find(high)!=ms.end()){\n                    ans.push_back(low+(k/2));\n                    ms.erase(ms.begin());\n                    auto it=ms.find(high);\n                    ms.erase(it);\n                    cnt+=2;\n                }\n                else break;\n            }\n            if(cnt==n){\n                return ans;\n            }\n        }\n        return {};\n    }\n};\n```
['C']