✅easy solution ✅100% Fastest Approach ✅Brute force Solution
Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F\nFoll
***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***<br>\n**Follow me on LinkeDin [[click Here](https://www.linkedin.com/in/ayushluthra62/)]**\n\n# Approach\nApproach is very simple \n- just find all the difference \n- for every difference create a new array that include nums1 values + difference\n- and check if both the array new array and  nums2 is equal if yes then it can be our answer store it \n- return minimum among all of the answer \n\n\n\n# Code\n```\nclass Solution {\npublic:\n   bool  check(vector<int>& temp, vector<int>& nums2){\n       int i=0;\n       int j=0;\n       int count=0;\n       while(i<temp.size() && j<nums2.size() ){\n           if(temp[i]==nums2[j]) i++,j++;\n           else{\n               i++;\n               count++;\n           }\n           if(count>2) return false;\n       }\n      return true;\n   }\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        sort(nums1.begin(),nums1.end());\n        sort(nums2.begin(),nums2.end());\n        int ans=INT_MAX;\n        unordered_map<int,int>mapping;\n        for(int i=0;i<nums1.size();i++){\n            for(int j=0;j<nums2.size();j++){\n                int diff=nums2[j]-nums1[i];\n                mapping[diff]++;\n            }\n        }\n        for(auto i : mapping){\n            vector<int>temp;\n            int diff=i.first;\n            //cout<<diff<<endl;\n            for(int i=0;i<nums1.size();i++){\n                \n                temp.push_back(nums1[i]+diff);\n            }\n            sort(temp.begin(),temp.end());\n            if(check(temp,nums2)) ans=min(ans,diff);\n        }\n        return ans;\n    }\n\n};\n```\n***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***<br>\n**Follow me on LinkeDin [[click Here](https://www.linkedin.com/in/ayushluthra62/)]**
['Hash Table', 'Sorting', 'C++']