[Python3/Python] Easy readable solution with comments.
\nclass Solution:\n    \n    def minDifference(self, nums: List[int]) -> int:\n        \n        n = len(nums)\n        # If nums are less than 3 all can be rep
```\nclass Solution:\n    \n    def minDifference(self, nums: List[int]) -> int:\n        \n        n = len(nums)\n        # If nums are less than 3 all can be replace,\n        # so min diff will be 0, which is default condition\n        if n > 3:\n            \n            # Init min difference\n            min_diff = float("inf")\n            \n            # sort the array\n            nums = sorted(nums)\n            \n            # Get the window size, this indicates, if we\n            # remove 3 element in an array how many element\n            # are left, consider 0 as the index, window\n            # size should be (n-3), but for array starting\n            # with 0 it should be ((n-1)-3)\n            window = (n-1)-3\n            \n            # Run through the entire array slinding the\n            # window and calculating minimum difference\n            # between the first and the last element of\n            # that window\n            for i in range(n):\n                if i+window >= n:\n                    break\n                else:\n                    min_diff = min(nums[i+window]-nums[i], min_diff)\n                    \n            # return calculated minimum difference\n            return min_diff\n        \n        return 0 # default condition\n```
['Sorting', 'Python', 'Python3']