✅Easy and simple solution  ✅clean code
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\nwe need to find minimum difference between partition of 1 array into two parts such that we can only pic max element from left and min element from right \nor any two element \nfor example \nin this now we have to  divide array such a way we got low differecne\n1245\ndiff 1 2 = 1  {1} , {2,4,5}\ndiff 2 4 = 2 {1, 2} , {4,5};\ndiff 4 5 = 1 {1,2,4}  {5}\nso minimum difference is 1\n\nso you can  easily from the example if we sort the array we will get our answer as left part will always  contain maximum element and right part will always have  minimum as possible \n \n\n# Complexity\n- Time complexity:\nO(NLogN)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int findValueOfPartition(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int mini =INT_MAX;\n        for(int i=0;i<nums.size()-1;i++) mini =min(mini,nums[i+1]-nums[i]);\n        return mini;\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/)]**
['C++']