C Solution
Intuition\n- Sort\n- Compare i and i + k - 1, which is the Difference Between Highest and Lowest of K Scores\n Describe your first thoughts on how to solve this
# Intuition\n- Sort\n- Compare `i` and `i + k - 1`, which is the Difference Between Highest and Lowest of K Scores\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n1. Quick sort\n2. For loop:\nCompare `i` and `i + k - 1`, choose the minimum one\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: `O(n)`\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: `O(1)`, does recursion stack space count? `O(n)`\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nvoid swap(int *a, int *b)\n{\n  int t = *a;\n  *a = *b;\n  *b = t;\n}\n\nint partition(int *a, int x, int y)\n{\n  int i = x - 1, pk = a[y];\n  for (int j = x; j < y; j++)\n  {\n    if (a[j] <= a[y])\n    {\n      i++;\n      swap(&a[i], &a[j]);\n    }\n  }\n  swap(&a[i + 1], &a[y]);\n  return i + 1;\n}\n\nvoid quickSort(int *a, int x, int y)\n{\n  if (x < y)\n  {\n    int q = partition(a, x, y);\n    quickSort(a, x, q - 1);\n    quickSort(a, q + 1, y);\n  }\n}\n\nint minimumDifference(int* nums, int numsSize, int k){\n  if(numsSize == 1)\n    return 0;\n  quickSort(nums, 0, numsSize - 1);\n  int returnValue = nums[k - 1] - nums[0];\n  for (size_t i = 1; i < numsSize - k + 1; i++)\n  {\n    if(returnValue > nums[i + k - 1] - nums[i])\n      returnValue = nums[i + k - 1] - nums[i];\n  }\n  return returnValue;\n}\n```
['C']