Beats 91% - Simple sorting || CPP || JAVA || PYTHON
IntuitionApproachSimple Sort operation and just finding the minimum abs value of diffrence between two number.Complexity

Time complexity: O(nlogn) --for sortin
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
Simple Sort operation and just finding the minimum abs value of diffrence between two number.
# Complexity
- Time complexity: $$O(nlogn)$$ --for sorting +$$O(nlogn)$$ --traversal

- Space complexity:$$O(1)$$ 
<!-- Add your space complexity here, e.g. -->

# Code
```cpp []
class Solution {
public:
    int findValueOfPartition(vector<int>& nums) {
        sort(begin(nums),end(nums));
        int mini=INT_MAX;
        for(int i=0;i<nums.size()-1;i++){
            mini=min(mini,abs(nums[i]-nums[i+1]));
        }
        return mini;
    }
};
```
```java []
import java.util.Arrays;

class Solution {
    public int findValueOfPartition(int[] nums) {
        Arrays.sort(nums);
        int mini = Integer.MAX_VALUE;
        for (int i = 0; i < nums.length - 1; i++) {
            mini = Math.min(mini, Math.abs(nums[i] - nums[i + 1]));
        }
        return mini;
    }
}

```
```py []
class Solution:
    def findValueOfPartition(self, nums):
        nums.sort()
        mini = float('inf')
        for i in range(len(nums) - 1):
            mini = min(mini, abs(nums[i] - nums[i + 1]))
        return mini

```
['Array', 'Sorting', 'C++', 'Java', 'Python3']