For this Question: You are given an integer array A and an integer K.
In one operation, you can choose any index i where 0 &le; i < A.length and change A[i] to A[i] + x where x is an integer from the range [- K, K]. You can apply this operation at most once for each index i. The score of A is the difference between the maximum and minimum elements in A.
Return the minimum score of A after applying the mentioned operation at most once for each index in it.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>smallestRangeI()</b> that takes the array A and integer K as a parameter.

<b>Constarints</b>
1 &le; A.length &le; 10<sup>3</sup>
0 &le; A[i] &le; 10<sup>4</sup>
0 &le; K &le; 10<sup>4</sup>Return the minimum score of A after applying the mentioned operation at most once for each index in it.Sample input:
3
1 3 6
3

Sample output:
0

<b>Explanation</b>
Change A to be [4, 4, 4]. The score is max(A) - min(A) = 4 - 4 = 0.

Sample Input:
4
1 5 2 4
2

Sample Output:
3

Explanation:
To minimize the difference between the maximum and minimum elements in the array, you can perform the following operations:

<ul>
<li>Add 2 to index 0: A = [3, 5, 2, 4]. Now the minimum value in the array is 2, and the maximum value is 5. The difference between them is 3.</li>
<li>Subtract 2 to index 1: A = [3, 3, 2, 4]. Now the minimum value in the array is 2, and the maximum value is 4. The difference between them is 1.</li>
<li>Add 1 to index 2: A = [3, 3, 3, 4]. Now the minimum value in the array is 3, and the maximum value is 4. The difference between them is 1.</li>
<li>Subtract 1 to index 3: A = [3, 3, 3, 3]. Now the minimum value in the array is 3, and the maximum value is 3. The difference between them is 0.</li>
</ul>
Therefore, the minimum score of the array is 0., I have written this Solution Code: class Solution {
    public int smallestRangeI(int[] A, int K) {
        int min = A[0], max = A[0];
        
        for(int i = 1; i < A.length; i++) {
            if(A[i] > max) max = A[i];
            else if(A[i] < min) min = A[i];
        }
        
        if(max - min - 2*K <= 0) return 0;
        return max - min - 2*K;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?