O(N^2) Time solution without hashMap
The idea is similar to most of the Solutions on Discuss page, Only difference is function used to find the original array given a value of k.\nInstead of using 
The idea is similar to most of the Solutions on Discuss page, Only difference is function used to find the original array given a value of k.\nInstead of using a Hashmap or multiset. This solution uses to 2-pointer approch which is guaranteed O(N) time, getting rid of hash colliosions in case of HashMap.\n\n```\n\nclass Solution {\npublic:\n    \n    vector<int> recoverArray(vector<int>& a) {\n        sort(a.begin(), a.end());\n        int n = a.size();\n        for(int i = 1; i < n; i++) {\n            \n            int dif = a[i] - a[0];\n            if(!dif || dif&1)\n                continue;\n            int k = dif/2;\n            \n            vector<int> resultArray = getResultArray(a, n, k);\n            if(resultArray.size() == n/2)\n                return resultArray;\n        }\n        \n        return {};\n    }\n    \n    vector<int> getResultArray(vector<int> &a, int n, int k) {\n        \n        int left = 0, right = 1;\n        vector<bool> done(n);\n            \n        vector<int> resultArray;\n        \n        while(right < n) {\n            if(done[left]) {\n                left++;\n                continue;\n            }\n            if(done[right]) {\n                right++;\n                continue;\n            }\n            int dif = a[right] - a[left];\n            if(dif < 2*k) {\n                right++;\n            }\n            else if(dif > 2*k) {\n                left++;\n            }\n            else {\n                done[left] = 1; done[right] = 1;\n                resultArray.push_back(a[left]+k);\n                left++;\n                right++;\n            }\n        }\n        \n        return resultArray;\n    }\n    \n    \n};\n\n```
['Two Pointers', 'C']