Java Sorting and Sliding Window
\nclass Solution {\n    public int minimumDifference(int[] A, int k) {\n      \n        Arrays.sort(A);\n        \n        int start=0;\n        int end=k-1;\n 
```\nclass Solution {\n    public int minimumDifference(int[] A, int k) {\n      \n        Arrays.sort(A);\n        \n        int start=0;\n        int end=k-1;\n        int OvrMin=Integer.MAX_VALUE;\n        \n        int N=A.length;\n        //after sorting in a window of size k the smallest no is at start  and highest no is At  end \n        \n        while(end<N)\n        {\n               int diff=A[end]-A[start];\n            \n               OvrMin=Math.min(OvrMin,diff);\n            \n                start++;\n                end++;\n        }//\n        \n        return OvrMin;\n        \n    }\n}\n```
['Sliding Window', 'Sorting', 'Java']