✅ One Line Solution
Code #1\nTime complexity: O(n). Space complexity: O(1).\n\nclass Solution:\n    def minDifference(self, a: List[int]) -> int:\n        return min(map(sub,nlarge
# Code #1\nTime complexity: $$O(n)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def minDifference(self, a: List[int]) -> int:\n        return min(map(sub,nlargest(4,a)[::-1],nsmallest(4,a)))\n```\n\n# Code #2\nTime complexity: $$O(n*log(n))$$. Space complexity: $$O(n)$$.\n```\nclass Solution:\n    def minDifference(self, a: List[int]) -> int:\n        return min(map(sub,(a:=sorted(a))[-4:],a[:4]))\n```\n[Ref](https://leetcode.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/solutions/730567/java-c-python-straight-forward)
['Array', 'Sorting', 'Python', 'Python3']