1984. Minimum Difference Between Highest and Lowest of K Scores
---\n\nThis looks a bit difficult for an Easy problem\n\n---\n\nHope it is simple to understand.\n\n---\n\n\nvar minimumDifference = function (nums, k) {\n    r
---\n\nThis looks a bit difficult for an Easy problem\n\n---\n\nHope it is simple to understand.\n\n---\n\n```\nvar minimumDifference = function (nums, k) {\n    return nums.length === 1\n        ? 0\n        : nums\n              .sort((a, b) => a - b)\n              .reduce(\n                  (minDiff, _, i) =>\n                      i >= k - 1 //\n                          ? Math.min(minDiff, nums[i] - nums[i - k + 1])\n                          : Infinity,\n                  Infinity\n              );\n};\n```\n\n---\n
['JavaScript']