Linear Search for solution
Intuition: Linear Search for solution, if it\'s possible (which we can check using hashmap), return the smallest value which is achievable if you start from 0 t
**Intuition:** Linear Search for solution, if it\'s possible (which we can check using hashmap), return the smallest value which is achievable if you start from `0` to `n`\n\n```cpp\nclass Solution {\npublic:\n    \n    bool isPossible(vector<int>& A, unordered_map<int, int> freq, int x) {\n        int pending = A.size();\n        for (int i: A) {\n            if (freq.find(i + x) != freq.end()) {\n                freq[i+x]--;\n                if (freq[i+x] == 0) {\n                    freq.erase(i+x);\n                }\n                pending--;\n            } \n        }\n        return pending == 2;\n    }\n    \n    int minimumAddedInteger(vector<int>& A, vector<int>& B) {\n        unordered_map<int, int> freq;\n        for (int i: B) {\n            freq[i]++;\n        }\n        for (int i = -1001; i <= 1000; i++) {\n            if (isPossible(A, freq, i)) {\n                return i;\n            }\n        }\n        return INT_MIN;\n    }\n};\n```
['C']