[Java] Best choice from three cases
Intuition\n Describe your first thoughts on how to solve this problem. \nJust sort the array and use greedy method.\n\n# Approach\n Describe your approach to so
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nJust sort the array and use greedy method.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n**We can alwasy make lower score to 0 by keeping same number, so we can focus on high score.**\n\nTo get minimum high score, we should keep minimum of |hightest - lowerest| value.\nWe have three cases:\n1. Change `nums[0]` and `nums[1]` to `nums[2]`\n2. Change `nums[0]` to `nums[1]` and `nums[n - 1]` to `nums[n - 2]`\n3. Change `nums[n - 2]` and `nums[n - 1]` to `nums[n - 3]`\n\n# Complexity\n- Time complexity: $$O(N*logN)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n  public int minimizeSum(int[] nums) {\n    final int n = nums.length;\n    Arrays.sort(nums);\n    // high score\n    int high = Integer.MAX_VALUE;\n    // left and right\n    high = Math.min(high, nums[n - 2] - nums[1]);\n\n    // right and right\n    high = Math.min(high, nums[n - 3] - nums[0]);\n\n    // left and left\n    high = Math.min(high, nums[n - 1] - nums[2]);\n\n    return high;\n  }\n}\n\n```
['Greedy', 'Java']