✔️ 100% Fastest TypeScript Solution
\nfunction minDifference(nums: number[]): number {\n  if (nums.length <= 4) return 0\n\n  nums.sort((a, b) => a - b)\n\n  let opts = [\n    nums[nums.length - 4
```\nfunction minDifference(nums: number[]): number {\n  if (nums.length <= 4) return 0\n\n  nums.sort((a, b) => a - b)\n\n  let opts = [\n    nums[nums.length - 4] - nums[0],\n    nums[nums.length - 3] - nums[1],\n    nums[nums.length - 2] - nums[2],\n    nums[nums.length - 1] - nums[3],\n  ]\n\n  return Math.min(...opts)\n}\n```\n\nLet me know in comments if you have any doubts. I will be happy to answer.\n\nPlease upvote if you found the solution useful.
['TypeScript', 'JavaScript']