C++ || Simple Maths || With Explanation
```\n/ so array elements are  of form\nA-K   B-K  C-K   A+K     B+K        C+K  but we dont  know actual sequence\nsubstrate A-K   from the whole so\n0       B-
```\n/* so array elements are  of form\nA-K   B-K  C-K   A+K     B+K        C+K  but we dont  know actual sequence\nsubstrate A-K   from the whole so\n0       B-A  C-A   2K     B-A+2K   C-A+2K\nso we calculate  2k that is the Doublediff and store in  doublediff  vector \n\nso we put all possibel value of double diff in doublediff vector\nwe iterate through every diff in double diff and try to form our ans\nfor  diff :doubeldiff\n    iteration 1:  \n\t                getsolution      // Explantion of getsolution function\n\t\t\t\t\t{\n\t                we store freq of every element in map\n\t                 we assume A-K as the first element in nums\n\t\t\t\t\t and we calculate wheteher a+k is present or not bu A-K+ diff       where diff= 2k\n\t\t\t\t\t if\n\t\t\t\t\t {we find A+K  we decrement its freq by 1\n\t\t\t\t\t and we calculate the A as   A=A-K + diff/2;\n\t\t\t\t\t }\n\t\t\t\t\t else    we return \n\t\t\t\t\t }\n\t\t\t\t\t if (ans.size()== nums.size()/2)     return ans\n\t\t\t\t\t \n\titeration 2....\n\titeration 3..\n\t return empty array  */\n\t\t\t\t\t \n\nclass Solution {\npublic:\n    vector<int> getdoublediff(vector<int> nums)\n    {\n        int n= nums.size(),dif;\n        vector<int> diff;\n        \n        for (int i=0;i<n;i++)\n        {\n            dif= nums[i]-nums[0];\n            if (dif >0  && (dif %2==0))   diff.push_back(dif);\n        }\n        return diff;\n    }\n    vector<int> getsolution(vector<int> nums,int diff)\n    {\n        int n=nums.size();\n        unordered_map<int,int> mp;\n        vector<int> res;\n        for (auto x: nums) mp[x]++;\n        for (int i=0;i<n;i++)\n        {\n            if (mp.find(nums[i])!=mp.end())\n            {\n                mp[nums[i]]--;\n                if (mp[nums[i]]==0)  mp.erase(nums[i]);\n                \n                int val= nums[i]+diff;\n                if (mp.find(val)==mp.end())   return res;\n                else\n                {\n                    mp[val]--;\n                    if (mp[val]==0)  mp.erase(val);\n                    \n                    res.push_back(nums[i]+(diff)/2);\n                }\n            }\n        }\n        return res;\n    }\n    vector<int> recoverArray(vector<int>& nums) {\n        \n            int n= nums.size();\n            sort(nums.begin(),nums.end());\n        \n        vector<int> doublediff= getdoublediff(nums);\n        \n        for (auto diff : doublediff)\n        {\n            vector<int> ans= getsolution(nums,diff);\n            if (ans.size()  == (n/2))    return ans;\n        }\n        vector<int>res;\n        return res;\n        \n    }\n};\n\n// Plz upvote as it encourage me to write more detailed solution
[]